search: optimize counting posts for fav: and pool: searches.

Optimize counting the number of posts returned by fav:<name> and
pool:<name> searches. Use cached counts to avoid slow count(*) queries
for users with lots of favorites.
This commit is contained in:
evazion
2021-10-08 19:49:15 -05:00
parent 26a411ba27
commit c4eeeb8531
3 changed files with 45 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
FactoryBot.define do
factory(:favorite)
factory(:favorite) do
user
post
end
end