Add tag index.
authorRoger Braun <roger@rogerbraun.net>
Sun, 17 Sep 2017 12:05:53 +0000 (14:05 +0200)
committerRoger Braun <roger@rogerbraun.net>
Sun, 17 Sep 2017 12:05:53 +0000 (14:05 +0200)
This still isn't optimal, but at least it isn't super slow.

priv/repo/migrations/20170917120416_add_tag_index.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20170917120416_add_tag_index.exs b/priv/repo/migrations/20170917120416_add_tag_index.exs
new file mode 100644 (file)
index 0000000..d9391dd
--- /dev/null
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.AddTagIndex do
+  use Ecto.Migration
+
+  @disable_ddl_transaction true
+
+  def change do
+    create index(:activities, ["(data #> '{\"object\",\"tag\"}')"], concurrently: true, using: :gin, name: :activities_tags)
+  end
+end