]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add index for recently added SQL query
authorChocobozzz <me@florianbigard.com>
Mon, 23 Dec 2019 10:55:51 +0000 (11:55 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 23 Dec 2019 12:44:24 +0000 (13:44 +0100)
server/models/video/video.ts

index 913d2d4a90a9f22c6c868d615539a220057b2e59..e58146ccf5821bc4eb39a62ef7e1c4a4ddfd0867 100644 (file)
@@ -149,7 +149,12 @@ const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [
   buildTrigramSearchIndex('video_name_trigram', 'name'),
 
   { fields: [ 'createdAt' ] },
-  { fields: [ 'publishedAt' ] },
+  {
+    fields: [
+      { name: 'publishedAt', order: 'DESC' },
+      { name: 'id', order: 'ASC' }
+    ]
+  },
   { fields: [ 'duration' ] },
   { fields: [ 'views' ] },
   { fields: [ 'channelId' ] },