Use desc id to sort instead of desc inserted_at
Should mean the same and is indexed.
This commit is contained in:
parent
003cb17b16
commit
678dd4c8ec
3 changed files with 3 additions and 3 deletions
|
|
@ -152,7 +152,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do
|
|||
query = from activity in Activity,
|
||||
where: fragment("? @> ?", activity.data, ^%{type: "Follow", actor: follower_id,
|
||||
object: followed_id}),
|
||||
order_by: [desc: :inserted_at],
|
||||
order_by: [desc: :id],
|
||||
limit: 1
|
||||
Repo.one(query)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue