Order by id instead of inserted_at to better use indexes.
authorRoger Braun <roger@rogerbraun.net>
Tue, 8 Aug 2017 10:24:20 +0000 (12:24 +0200)
committerRoger Braun <roger@rogerbraun.net>
Tue, 8 Aug 2017 10:24:20 +0000 (12:24 +0200)
lib/pleroma/web/activity_pub/activity_pub.ex

index 69a2d8f4ef23c18d5d59eff3b17e1b43af602ea7..fbe259f50c79bb4b713a921ad44f002543528a5f 100644 (file)
@@ -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)