diff options
author | lain <lain@soykaf.club> | 2020-05-27 09:46:12 +0200 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-06-08 01:19:57 +0300 |
commit | e9aa6a3fa4e0c417c39fce0a5408294f6d4d1842 (patch) | |
tree | 94fa8641c74bdf572acae7509823ca8347e315ad | |
parent | 3687788cf2ab91f6f40f76f9a82c448c477b1fec (diff) | |
download | pleroma-e9aa6a3fa4e0c417c39fce0a5408294f6d4d1842.tar.gz |
ActivityPub: Change ordering to `nulls last` in favorites query
This makes it use our existing index and speeds up the query.
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index c4f83f9e1..5ce91a8d3 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1318,7 +1318,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> Activity.with_joined_object() |> Object.with_joined_activity() |> select([_like, object, activity], %{activity | object: object}) - |> order_by([like, _, _], desc: like.id) + |> order_by([like, _, _], desc_nulls_last: like.id) |> Pagination.fetch_paginated( Map.merge(params, %{"skip_order" => true}), pagination, |