Make search use id index too.
authorlain <lain@soykaf.club>
Sat, 21 Apr 2018 07:22:31 +0000 (09:22 +0200)
committerlain <lain@soykaf.club>
Sat, 21 Apr 2018 07:22:31 +0000 (09:22 +0200)
Seems to be faster in general, query planner chooses well.

lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

index 8b3492332c23340a6ee5a25c4c6e1fdcf9436931..c84c226e8176ab7ea28634df3cfb4d5adff2dc89 100644 (file)
@@ -521,7 +521,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
             ^query
           ),
         limit: 20,
             ^query
           ),
         limit: 20,
-        order_by: [desc: :inserted_at]
+        order_by: [desc: :id]
       )
 
     statuses = Repo.all(q) ++ fetched
       )
 
     statuses = Repo.all(q) ++ fetched