From 545eae5c60b209869d193ec1af8e30a09d17730a Mon Sep 17 00:00:00 2001 From: Peter Broadhurst Date: Tue, 26 Oct 2021 07:58:49 -0400 Subject: [PATCH] Add topic+tag index to messages Signed-off-by: Peter Broadhurst --- .../postgres/000037_add_message_topic_tag_index.down.sql | 3 +++ .../postgres/000037_add_message_topic_tag_index.up.sql | 3 +++ .../sqlite/000037_add_message_topic_tag_index.down.sql | 1 + db/migrations/sqlite/000037_add_message_topic_tag_index.up.sql | 1 + 4 files changed, 8 insertions(+) create mode 100644 db/migrations/postgres/000037_add_message_topic_tag_index.down.sql create mode 100644 db/migrations/postgres/000037_add_message_topic_tag_index.up.sql create mode 100644 db/migrations/sqlite/000037_add_message_topic_tag_index.down.sql create mode 100644 db/migrations/sqlite/000037_add_message_topic_tag_index.up.sql diff --git a/db/migrations/postgres/000037_add_message_topic_tag_index.down.sql b/db/migrations/postgres/000037_add_message_topic_tag_index.down.sql new file mode 100644 index 0000000000..4dc56f8b37 --- /dev/null +++ b/db/migrations/postgres/000037_add_message_topic_tag_index.down.sql @@ -0,0 +1,3 @@ +BEGIN; +DROP INDEX messages_topics_tag; +COMMIT; diff --git a/db/migrations/postgres/000037_add_message_topic_tag_index.up.sql b/db/migrations/postgres/000037_add_message_topic_tag_index.up.sql new file mode 100644 index 0000000000..462264a85a --- /dev/null +++ b/db/migrations/postgres/000037_add_message_topic_tag_index.up.sql @@ -0,0 +1,3 @@ +BEGIN; +CREATE INDEX messages_topics_tag ON messages(namespace,topics,tag); +COMMIT; diff --git a/db/migrations/sqlite/000037_add_message_topic_tag_index.down.sql b/db/migrations/sqlite/000037_add_message_topic_tag_index.down.sql new file mode 100644 index 0000000000..89e413e10a --- /dev/null +++ b/db/migrations/sqlite/000037_add_message_topic_tag_index.down.sql @@ -0,0 +1 @@ +DROP INDEX messages_topics_tag; diff --git a/db/migrations/sqlite/000037_add_message_topic_tag_index.up.sql b/db/migrations/sqlite/000037_add_message_topic_tag_index.up.sql new file mode 100644 index 0000000000..e98c548448 --- /dev/null +++ b/db/migrations/sqlite/000037_add_message_topic_tag_index.up.sql @@ -0,0 +1 @@ +CREATE INDEX messages_topics_tag ON messages(namespace,topics,tag);