mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-06-01 08:28:06 +00:00
Switch to inner joins which are expected to be faster
This commit is contained in:
parent
0e1356ef9c
commit
d8c112f2b0
|
@ -179,7 +179,7 @@ defmodule Pleroma.Activity do
|
|||
def get_by_ap_id_with_object(ap_id) do
|
||||
ap_id
|
||||
|> Queries.by_ap_id()
|
||||
|> with_preloaded_object(:left)
|
||||
|> with_preloaded_object(:inner)
|
||||
|> Repo.one()
|
||||
end
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
|
|||
end)
|
||||
|> Enum.map(&object_id_for/1)
|
||||
|> Activity.create_by_object_ap_id()
|
||||
|> Activity.with_preloaded_object(:left)
|
||||
|> Activity.with_preloaded_object(:inner)
|
||||
|> Pleroma.Repo.all()
|
||||
|
||||
relationships_opt =
|
||||
|
|
|
@ -103,7 +103,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
|> Enum.filter(&(&1.data["type"] == "Announce" && &1.data["object"]))
|
||||
|> Enum.map(&Object.normalize(&1, fetch: false).data["id"])
|
||||
|> Activity.create_by_object_ap_id()
|
||||
|> Activity.with_preloaded_object(:left)
|
||||
|> Activity.with_preloaded_object(:inner)
|
||||
|> Activity.with_preloaded_bookmark(reading_user)
|
||||
|> Activity.with_set_thread_muted_field(reading_user)
|
||||
|> Repo.all()
|
||||
|
|
Loading…
Reference in a new issue