1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-04 15:26:08 +02:00

perf(server): Reduce database query

Related: #6813
This commit is contained in:
syuilo
2021-03-20 13:54:59 +09:00
parent e523e54881
commit f27e4033a6
21 changed files with 240 additions and 27 deletions

View File

@@ -131,6 +131,10 @@ export default define(meta, async (ps, user) => {
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
.andWhere(`note.userId IN (${ listQuery.getQuery() })`)
.leftJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply')
.leftJoinAndSelect('note.renote', 'renote')
.leftJoinAndSelect('reply.user', 'replyUser')
.leftJoinAndSelect('renote.user', 'renoteUser')
.setParameters(listQuery.getParameters());
generateVisibilityQuery(query, user);