remove unused left joins
This commit is contained in:
parent
2937c7fa43
commit
b8e3de7ddf
3 changed files with 2 additions and 24 deletions
|
@ -79,12 +79,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
ps.untilDate,
|
ps.untilDate,
|
||||||
)
|
)
|
||||||
.andWhere("note.visibility = 'public'")
|
.andWhere("note.visibility = 'public'")
|
||||||
.andWhere("note.channelId IS NULL")
|
.andWhere("note.channelId IS NULL");
|
||||||
.innerJoinAndSelect("note.user", "user")
|
|
||||||
.leftJoinAndSelect("note.reply", "reply")
|
|
||||||
.leftJoinAndSelect("note.renote", "renote")
|
|
||||||
.leftJoinAndSelect("reply.user", "replyUser")
|
|
||||||
.leftJoinAndSelect("renote.user", "renoteUser");
|
|
||||||
|
|
||||||
generateRepliesQuery(query, ps.withReplies, user);
|
generateRepliesQuery(query, ps.withReplies, user);
|
||||||
if (user) {
|
if (user) {
|
||||||
|
|
|
@ -95,11 +95,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
).orWhere("(note.visibility = 'public') AND (note.userHost IS NULL)");
|
).orWhere("(note.visibility = 'public') AND (note.userHost IS NULL)");
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.innerJoinAndSelect("note.user", "user")
|
|
||||||
.leftJoinAndSelect("note.reply", "reply")
|
|
||||||
.leftJoinAndSelect("note.renote", "renote")
|
|
||||||
.leftJoinAndSelect("reply.user", "replyUser")
|
|
||||||
.leftJoinAndSelect("renote.user", "renoteUser")
|
|
||||||
.setParameters(followingQuery.getParameters());
|
.setParameters(followingQuery.getParameters());
|
||||||
|
|
||||||
generateChannelQuery(query, user);
|
generateChannelQuery(query, user);
|
||||||
|
|
|
@ -87,19 +87,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
ps.untilId,
|
ps.untilId,
|
||||||
ps.sinceDate,
|
ps.sinceDate,
|
||||||
ps.untilDate,
|
ps.untilDate,
|
||||||
)
|
).andWhere("(note.visibility = 'public') AND (note.userHost IS NULL)");
|
||||||
.andWhere("(note.visibility = 'public') AND (note.userHost IS NULL)")
|
|
||||||
.innerJoinAndSelect("note.user", "user")
|
|
||||||
.leftJoinAndSelect("user.avatar", "avatar")
|
|
||||||
.leftJoinAndSelect("user.banner", "banner")
|
|
||||||
.leftJoinAndSelect("note.reply", "reply")
|
|
||||||
.leftJoinAndSelect("note.renote", "renote")
|
|
||||||
.leftJoinAndSelect("reply.user", "replyUser")
|
|
||||||
.leftJoinAndSelect("replyUser.avatar", "replyUserAvatar")
|
|
||||||
.leftJoinAndSelect("replyUser.banner", "replyUserBanner")
|
|
||||||
.leftJoinAndSelect("renote.user", "renoteUser")
|
|
||||||
.leftJoinAndSelect("renoteUser.avatar", "renoteUserAvatar")
|
|
||||||
.leftJoinAndSelect("renoteUser.banner", "renoteUserBanner");
|
|
||||||
|
|
||||||
generateChannelQuery(query, user);
|
generateChannelQuery(query, user);
|
||||||
generateRepliesQuery(query, ps.withReplies, user);
|
generateRepliesQuery(query, ps.withReplies, user);
|
||||||
|
|
Loading…
Reference in a new issue