remove unused left joins

This commit is contained in:
Namekuji 2023-08-01 02:44:47 -04:00
parent 2937c7fa43
commit b8e3de7ddf
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532
3 changed files with 2 additions and 24 deletions

View file

@ -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) {

View file

@ -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);

View file

@ -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);