mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
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)
|
def categories_ignored(posts)
|
||||||
posts.where(<<~SQL, Searchable::PRIORITIES[:ignore])
|
posts.where(<<~SQL, Searchable::PRIORITIES[:ignore])
|
||||||
categories.id NOT IN (
|
(categories.search_priority IS NULL OR categories.search_priority IS NOT NULL AND categories.search_priority <> ?)
|
||||||
SELECT categories.id WHERE categories.search_priority = ?
|
|
||||||
)
|
|
||||||
SQL
|
SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user