From: Ivan Tashkinov Date: Wed, 29 Dec 2021 08:41:21 +0000 (+0300) Subject: Added index on [:target_id, :relationship_type] to :user_relationships (speeds up... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=0c7fb520bf7d6d164a2334a23066d1188b2ec0e1;p=akkoma Added index on [:target_id, :relationship_type] to :user_relationships (speeds up `Notification.exclude_blockers/_`). --- diff --git a/priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs b/priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs new file mode 100644 index 000000000..fcefa6508 --- /dev/null +++ b/priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs @@ -0,0 +1,9 @@ +defmodule Pleroma.Repo.Migrations.UserRelationshipsTargetIdRelationshipTypeIndex do + use Ecto.Migration + + def change do + create_if_not_exists( + index(:user_relationships, [:target_id, :relationship_type]) + ) + end +end