Skip to content
Snippets Groups Projects
Commit 9fd86402 authored by lain's avatar lain
Browse files

Order by id instead of inserted_at to better use indexes.

parent 763756f8
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,7 @@ defp restrict_actor(query, _), do: query
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment