diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-12-07 12:08:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 12:08:30 +0100 |
commit | 48bef17cc990afda95c4de657f7643c321e62650 (patch) | |
tree | 01636821b1bbf46667e625bd842ee0bde65470d8 /app/models/form | |
parent | a8c471fcc043b61aa10cf8f849dfb552db7381d3 (diff) |
Fix slow distinct queries where grouped queries are faster (#15287)
About 2x speed-up on inboxes query
Diffstat (limited to 'app/models/form')
-rw-r--r-- | app/models/form/account_batch.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/form/account_batch.rb b/app/models/form/account_batch.rb index 882770d7c..26d6d3abf 100644 --- a/app/models/form/account_batch.rb +++ b/app/models/form/account_batch.rb @@ -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 |