From 9fd86402028fbf44fd417c2ee9017ca04623dc72 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 8 Aug 2017 12:24:20 +0200 Subject: [PATCH] Order by id instead of inserted_at to better use indexes. --- lib/pleroma/web/activity_pub/activity_pub.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 69a2d8f4e..fbe259f50 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -119,7 +119,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do def fetch_activities(recipients, opts \\ %{}) do base_query = from activity in Activity, limit: 20, - order_by: [desc: :inserted_at] + order_by: [desc: :id] base_query |> restrict_recipients(recipients) -- 2.45.2