mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 23:58:12 -05:00
PERF: Add user_id condition so we can use another index in the query
This commit is contained in:
@@ -39,6 +39,7 @@ class UserSummary
|
||||
def links
|
||||
TopicLink
|
||||
.joins(:topic, :post)
|
||||
.where(posts: { user_id: @user.id })
|
||||
.includes(:topic, :post)
|
||||
.where('posts.post_type IN (?)', Topic.visible_post_types(@guardian && @guardian.user))
|
||||
.merge(Topic.listable_topics.visible.secured(@guardian))
|
||||
|
||||
Reference in New Issue
Block a user