Use Account.local.sum(statuses_count) instead of Status.local.count (#4996)

It is faster.
th-downstream
Akihiko Odaki 7 years ago committed by Eugen Rochko
parent 0de28e70e8
commit f4e3449e61

@ -21,7 +21,7 @@ class InstancePresenter
end
def status_count
Rails.cache.fetch('local_status_count') { Status.local.count }
Rails.cache.fetch('local_status_count') { Account.local.sum(:statuses_count) }
end
def domain_count

Loading…
Cancel
Save