PERF: Remove extra subquery in search.
I also noticed that removing the subquery helps the planner to plan better.
This commit is contained in:
parent
630ec7b49c
commit
248bebb8cd
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue