PERF: Remove extra subquery in search.

PERF: Remove extra subquery in search.

I also noticed that removing the subquery helps the planner to plan better.

diff --git a/lib/search.rb b/lib/search.rb
index c2b4a13..9cf0c85 100644
--- a/lib/search.rb
+++ b/lib/search.rb
@@ -1024,9 +1024,7 @@ class Search
 
   def categories_ignored(posts)
     posts.where(<<~SQL, Searchable::PRIORITIES[:ignore])
-    categories.id NOT IN (
-      SELECT categories.id WHERE categories.search_priority = ?
-    )
+    (categories.search_priority IS NULL OR categories.search_priority IS NOT NULL AND categories.search_priority <> ?)
     SQL
   end
 

GitHub sha: 248bebb8