Commit 11dcec1f authored by Alper Akgun's avatar Alper Akgun

Merge branch '342543-add-full-index-on-namespaces-for-type-and-id-asynchronously' into 'master'

Add full index on namespaces for type and id and remove partial index

See merge request gitlab-org/gitlab!71845
parents 736d0a9f 0f3e7fc0
# frozen_string_literal: true
class AddNamespaceIndexOnTypeSync < Gitlab::Database::Migration[1.0]
FULL_INDEX_NAME = 'index_namespaces_on_type_and_id'
PARTIAL_INDEX_NAME = 'index_namespaces_on_type_and_id_partial'
disable_ddl_transaction!
def up
add_concurrent_index :namespaces, [:type, :id], name: FULL_INDEX_NAME
remove_concurrent_index_by_name :namespaces, name: PARTIAL_INDEX_NAME
end
def down
add_concurrent_index(:namespaces, [:type, :id], where: 'type IS NOT NULL', name: PARTIAL_INDEX_NAME)
remove_concurrent_index_by_name :namespaces, name: FULL_INDEX_NAME
end
end
15d1bc08a87241b4217278ce8214f41d1d3c0cc4c26a3e659f395a602d139758
\ No newline at end of file
......@@ -25838,7 +25838,7 @@ CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON names
CREATE INDEX index_namespaces_on_traversal_ids ON namespaces USING gin (traversal_ids);
CREATE INDEX index_namespaces_on_type_and_id_partial ON namespaces USING btree (type, id) WHERE (type IS NOT NULL);
CREATE INDEX index_namespaces_on_type_and_id ON namespaces USING btree (type, id);
CREATE INDEX index_namespaces_public_groups_name_id ON namespaces USING btree (name, id) WHERE (((type)::text = 'Group'::text) AND (visibility_level = 20));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment