Avoid potentially slow count queries for user note count.
authorRoger Braun <roger@rogerbraun.net>
Tue, 31 Oct 2017 15:37:11 +0000 (16:37 +0100)
committerRoger Braun <roger@rogerbraun.net>
Tue, 31 Oct 2017 15:37:11 +0000 (16:37 +0100)
commit4dcbb64f19723334a9ef66b4ce71856d30e32796
tree6a4bc599c164861108a40cc1933ed4c0f953c1c7
parent3037814fde83d869f7a71567511a6aa5e0700073
Avoid potentially slow count queries for user note count.

For a variety of reasons, posgresql won't use the available actor,
type index to do an index only scan. We now just increase the user
note count, which will lead to slightly wrong counts in some cases,
but it's better than the potentially very slow count query.
lib/pleroma/user.ex
lib/pleroma/web/common_api/common_api.ex
lib/pleroma/web/ostatus/handlers/note_handler.ex
test/user_test.exs