Commit cf139b06 authored by rinpatch's avatar rinpatch

Merge branch 'fav-speedup' into 'develop'

Fix favorites query performance

See merge request pleroma/pleroma!2591
parents 3601c001 d8d99fd4
......@@ -24,10 +24,7 @@ def by_ap_id(query \\ Activity, ap_id) do
@spec by_actor(query, String.t()) :: query
def by_actor(query \\ Activity, actor) do
from(
activity in query,
where: fragment("(?)->>'actor' = ?", activity.data, ^actor)
)
from(a in query, where: a.actor == ^actor)
end
@spec by_author(query, User.t()) :: query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment