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
|
@ -51,7 +51,7 @@ class Form::AccountBatch
|
|||
end
|
||||
|
||||
def account_domains
|
||||
accounts.pluck(Arel.sql('distinct domain')).compact
|
||||
accounts.group(:domain).pluck(:domain).compact
|
||||
end
|
||||
|
||||
def accounts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue