From 0c7fb520bf7d6d164a2334a23066d1188b2ec0e1 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Wed, 29 Dec 2021 11:41:21 +0300 Subject: [PATCH] Added index on [:target_id, :relationship_type] to :user_relationships (speeds up `Notification.exclude_blockers/_`). --- ...r_relationships_target_id_relationship_type_index.exs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs 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 -- 2.45.2