Extract counters from accounts table to account_stats table (#9295)

This commit is contained in:
Eugen Rochko 2018-11-19 00:43:52 +01:00 committed by GitHub
parent 4fdefffb99
commit d6b9a62e0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 203 additions and 68 deletions

View file

@ -22,7 +22,7 @@ class InstancePresenter
end
def status_count
Rails.cache.fetch('local_status_count') { Account.local.sum(:statuses_count) }
Rails.cache.fetch('local_status_count') { Account.local.joins(:account_stat).sum('account_stats.statuses_count') }
end
def domain_count