mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Fix N+1 queries problem when listing topics list (#20971)
This performance regression was introduced in
7c6a8f1c74 where the preloading of tags in
`TopicQuery` was accidentally removed.
This commit is contained in:
committed by
GitHub
parent
e586f6052f
commit
5bec894a8c
@@ -721,7 +721,11 @@ class TopicQuery
|
||||
end
|
||||
end
|
||||
|
||||
result = filter_by_tags(result)
|
||||
if SiteSetting.tagging_enabled
|
||||
result = result.includes(:tags)
|
||||
result = filter_by_tags(result)
|
||||
end
|
||||
|
||||
result = apply_ordering(result, options)
|
||||
|
||||
all_listable_topics =
|
||||
@@ -1151,8 +1155,6 @@ class TopicQuery
|
||||
end
|
||||
|
||||
def filter_by_tags(result)
|
||||
return result if !SiteSetting.tagging_enabled
|
||||
|
||||
tags_arg = @options[:tags]
|
||||
|
||||
if tags_arg && tags_arg.size > 0
|
||||
|
||||
Reference in New Issue
Block a user