From: Roger Braun Date: Tue, 8 Aug 2017 10:24:20 +0000 (+0200) Subject: Order by id instead of inserted_at to better use indexes. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9fd86402028fbf44fd417c2ee9017ca04623dc72;p=akkoma Order by id instead of inserted_at to better use indexes. --- 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)