From: Roman Chvanikov Date: Sat, 9 May 2020 10:13:26 +0000 (+0300) Subject: Use index on refresh_counter_cache X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=56819f7f0604e5d4eb69edba1d6828256acbc7fe;p=akkoma Use index on refresh_counter_cache --- diff --git a/lib/mix/tasks/pleroma/refresh_counter_cache.ex b/lib/mix/tasks/pleroma/refresh_counter_cache.ex index b44e2545d..efcbaa3b1 100644 --- a/lib/mix/tasks/pleroma/refresh_counter_cache.ex +++ b/lib/mix/tasks/pleroma/refresh_counter_cache.ex @@ -42,7 +42,7 @@ defmodule Mix.Tasks.Pleroma.RefreshCounterCache do Activity |> where([a], fragment("(? ->> 'type'::text) = 'Create'", a.data)) - |> where([a], like(a.actor, ^"%#{instance}%")) + |> where([a], fragment("split_part(?, '/', 3) = ?", a.actor, ^instance)) |> select( [a], {fragment(