From 3e36894ac77b84190135a5c5de6cc8f6b7588067 Mon Sep 17 00:00:00 2001 From: Shivashis Padhi Date: Wed, 3 Aug 2022 15:43:09 +0530 Subject: [PATCH] Avoid joining with Posts table while getting top user reactions --- store/sqlstore/reaction_store.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/store/sqlstore/reaction_store.go b/store/sqlstore/reaction_store.go index 7651257ff5..d1a56b6e08 100644 --- a/store/sqlstore/reaction_store.go +++ b/store/sqlstore/reaction_store.go @@ -316,8 +316,7 @@ func (s *SqlReactionStore) GetTopForUserSince(userID string, teamID string, sinc count(EmojiName) AS Count FROM Reactions - INNER JOIN Posts ON Reactions.PostId = Posts.Id - INNER JOIN Channels ON Posts.ChannelId = Channels.Id + INNER JOIN Channels ON Channels.Id = Reactions.ChannelId WHERE Reactions.DeleteAt = 0 AND Reactions.UserId = ?