diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-10-31 16:37:11 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-10-31 16:37:11 +0100 |
commit | 4dcbb64f19723334a9ef66b4ce71856d30e32796 (patch) | |
tree | 6a4bc599c164861108a40cc1933ed4c0f953c1c7 /lib/pleroma/web/common_api/common_api.ex | |
parent | 3037814fde83d869f7a71567511a6aa5e0700073 (diff) | |
download | pleroma-4dcbb64f19723334a9ef66b4ce71856d30e32796.tar.gz |
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.
Diffstat (limited to 'lib/pleroma/web/common_api/common_api.ex')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index a865cd143..c9822dc2d 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -61,7 +61,7 @@ defmodule Pleroma.Web.CommonAPI do context <- make_context(inReplyTo), object <- make_note_data(user.ap_id, to, context, content_html, attachments, inReplyTo, tags) do res = ActivityPub.create(to, user, context, object) - User.update_note_count(user) + User.increase_note_count(user) res end end |