From 611a72ae15ff0cd67e5abba215c8f8566652eb98 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 Dec 2019 11:55:51 +0100 Subject: Add index for recently added SQL query --- server/models/video/video.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 913d2d4a9..e58146ccf 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -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' ] }, -- cgit v1.2.3