Optimize videos list SQL query

pull/2393/head
Chocobozzz 2020-01-08 11:16:34 +01:00
parent 8ba9c205ba
commit 8ee988c316
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 8 additions and 1 deletions

View File

@ -452,7 +452,14 @@ export type AvailableForListIDsOptions = {
'SELECT "videoShare"."videoId" AS "id" FROM "videoShare" ' +
'INNER JOIN "actorFollow" ON "actorFollow"."targetActorId" = "videoShare"."actorId" ' +
'WHERE "actorFollow"."actorId" = ' + actorIdNumber +
' UNION ALL ' +
')'
)
}
},
{
id: {
[ Op.in ]: Sequelize.literal(
'(' +
'SELECT "video"."id" AS "id" FROM "video" ' +
'INNER JOIN "videoChannel" ON "videoChannel"."id" = "video"."channelId" ' +
'INNER JOIN "account" ON "account"."id" = "videoChannel"."accountId" ' +