diff options
author | Roger Braun <rbraun@Bobble.local> | 2017-10-24 14:16:17 +0200 |
---|---|---|
committer | Roger Braun <rbraun@Bobble.local> | 2017-10-24 14:16:17 +0200 |
commit | 9af560083fcc513a7b3c41b06f4ed307c50a7529 (patch) | |
tree | 2dcc9e3e845ef55ce1e29d261420aa4970b3d2d0 /lib | |
parent | 29c261e75ba10eac0cda8ec19d158d84c96f6572 (diff) | |
download | pleroma-9af560083fcc513a7b3c41b06f4ed307c50a7529.tar.gz |
Use more efficient user note count update query.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 938b57d90..bfd3a3ad7 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -241,7 +241,7 @@ defmodule Pleroma.User do def update_note_count(%User{} = user) do note_count_query = from a in Object, - where: fragment("? @> ?", a.data, ^%{actor: user.ap_id, type: "Note"}), + where: fragment("?->>'actor' = ? and ?->>'type' = 'Note'", a.data, ^user.ap_id, a.data), select: count(a.id) note_count = Repo.one(note_count_query) |