Follower requests: Utilize object index.
authorlain <lain@soykaf.club>
Wed, 27 Feb 2019 14:01:54 +0000 (15:01 +0100)
committerlain <lain@soykaf.club>
Wed, 27 Feb 2019 14:01:54 +0000 (15:01 +0100)
Closes #677

lib/pleroma/user.ex

index 01d532ab3158b3060e26a3fb0d3d69f6c37c5bcc..c5085fa8280c67cb7a62a107127ac1a9c500fe24 100644 (file)
@@ -613,9 +613,10 @@ defmodule Pleroma.User do
         ),
       where:
         fragment(
-          "? @> ?",
+          "coalesce((?)->'object'->>'id', (?)->>'object') = ?",
           a.data,
-          ^%{"object" => user.ap_id}
+          a.data,
+          ^user.ap_id
         )
     )
   end