diff options
author | lain <lain@soykaf.club> | 2020-05-27 09:46:12 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-27 09:46:12 +0200 |
commit | 7e13200869a41647f25bdcf416ecd36ff09219bc (patch) | |
tree | e59306b2b4b68aa454d6c4c91ab2441623c7b1d1 | |
parent | d8d99fd4cf56b4e3adb17c75062a08ec3fdebb89 (diff) | |
download | pleroma-7e13200869a41647f25bdcf416ecd36ff09219bc.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 0fe71694a..b8a2873d8 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1158,7 +1158,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, |