mirror of
https://github.com/discourse/discourse.git
synced 2025-03-20 16:35:34 +08:00
PERF: Add user_id condition so we can use another index in the query
This commit is contained in:
parent
73a3e2ccbc
commit
a4d5d1f51d
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user