From f364317625ee273d1e8983faa271831db912953b Mon Sep 17 00:00:00 2001 From: OsamaSayegh Date: Tue, 23 Jul 2019 03:52:52 +0000 Subject: [PATCH] PERF: Improve query speed when looking up direct PMs Follow up to https://github.com/discourse/discourse/commit/5fc5a7f5ae8c3cf1a89c1a685258e9e942de1508 --- lib/search.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/search.rb b/lib/search.rb index a109f48a026..9fcd1b76e7b 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -278,7 +278,6 @@ class Search ON tau2.topic_id = tau.topic_id AND tau2.id != tau.id WHERE tau.user_id = :user_id - AND tau.topic_id = posts.topic_id GROUP BY tau.topic_id HAVING COUNT(*) = 1 )