From ff5e9574760accbf92f6e351819e1566b835002e Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 21 Apr 2018 09:22:31 +0200 Subject: [PATCH] Make search use id index too. Seems to be faster in general, query planner chooses well. --- lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 8b3492332..c84c226e8 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -521,7 +521,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do ^query ), limit: 20, - order_by: [desc: :inserted_at] + order_by: [desc: :id] ) statuses = Repo.all(q) ++ fetched