diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-21 14:57:49 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:44:01 -0500 |
commit | 1c9e9213111471613c40ed74d7c0917b560b89f1 (patch) | |
tree | 72779eb410749f25d039dadb75afcc0907046081 /db | |
parent | 3f79c75942de0098d582916af3d12f506394d97d (diff) |
[Database] Add index on statuses.visibility column
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200721195456_add_index_on_statuses_visibility.rb | 7 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/db/migrate/20200721195456_add_index_on_statuses_visibility.rb b/db/migrate/20200721195456_add_index_on_statuses_visibility.rb new file mode 100644 index 000000000..c45405e95 --- /dev/null +++ b/db/migrate/20200721195456_add_index_on_statuses_visibility.rb @@ -0,0 +1,7 @@ +class AddIndexOnStatusesVisibility < ActiveRecord::Migration[5.2] + disable_ddl_transaction! + + def change + add_index :statuses, :visibility, where: 'deleted_at IS NULL', algorithm: :concurrently, name: :index_statuses_on_visibility + end +end diff --git a/db/schema.rb b/db/schema.rb index aa0790fc6..674ff8ab6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_07_21_184347) do +ActiveRecord::Schema.define(version: 2020_07_21_195456) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -811,6 +811,7 @@ ActiveRecord::Schema.define(version: 2020_07_21_184347) do t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_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 + t.index ["visibility"], name: "index_statuses_on_visibility", where: "(deleted_at IS NULL)" end create_table "statuses_tags", id: false, force: :cascade do |t| |