Fix slow distinct queries where grouped queries are faster (#15287)
About 2x speed-up on inboxes query
This commit is contained in:
parent
a8c471fcc0
commit
48bef17cc9
4 changed files with 4 additions and 4 deletions
|
@ -81,7 +81,7 @@ class AccountsController < ApplicationController
|
|||
end
|
||||
|
||||
def account_media_status_ids
|
||||
@account.media_attachments.attached.reorder(nil).select(:status_id).distinct
|
||||
@account.media_attachments.attached.reorder(nil).select(:status_id).group(:status_id)
|
||||
end
|
||||
|
||||
def no_replies_scope
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue