From 8d86c77a58c3eb20e0db15a7aa4b498ae4af1566 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 25 Dec 2022 04:04:29 +0000 Subject: [PATCH] db: add quote_id index --- .../20221224220348_add_index_to_statuses_quote_id.rb | 7 +++++++ db/schema.rb | 1 + 2 files changed, 8 insertions(+) create mode 100644 db/migrate/20221224220348_add_index_to_statuses_quote_id.rb diff --git a/db/migrate/20221224220348_add_index_to_statuses_quote_id.rb b/db/migrate/20221224220348_add_index_to_statuses_quote_id.rb new file mode 100644 index 00000000000..2a51daf883f --- /dev/null +++ b/db/migrate/20221224220348_add_index_to_statuses_quote_id.rb @@ -0,0 +1,7 @@ +class AddIndexToStatusesQuoteId < ActiveRecord::Migration[6.1] + disable_ddl_transaction! + + def change + add_index :statuses, :quote_id, algorithm: :concurrently + end +end diff --git a/db/schema.rb b/db/schema.rb index 8bacd84d9c1..c2d2bee5694 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -951,6 +951,7 @@ ActiveRecord::Schema.define(version: 2022_11_04_133904) do t.index ["id", "account_id"], name: "index_statuses_public_20200119", order: { id: :desc }, where: "((deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))" t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id", where: "(in_reply_to_account_id IS NOT NULL)" t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id", where: "(in_reply_to_id IS NOT NULL)" + t.index ["quote_id"], name: "index_statuses_on_quote_id" t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id" t.index ["uri"], name: "index_statuses_on_uri", unique: true, opclass: :text_pattern_ops, where: "(uri IS NOT NULL)" end