Skip to content

Commit

Permalink
fix(backend): timeout when querying mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
zekexy committed Sep 7, 2023
1 parent 90b058e commit 022f99c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/backend/src/server/api/endpoints/notes/mentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.where(`'{"${me.id}"}' <@ note.mentions`)
.orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`);
}))
// Avoid scanning primary key index
.orderBy('CONCAT(note.id)', 'DESC')
.innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply')
.leftJoinAndSelect('note.renote', 'renote')
Expand Down

0 comments on commit 022f99c

Please sign in to comment.