Commit 2ae8ab3a authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'remove-project-id-index-on-vulnerabilities-table' into 'master'

Remove compound index on (project_id, id) from vulnerabilities table

See merge request gitlab-org/gitlab!44422
parents 04337741 696ff2ae
---
title: Remove duplicate index from the Vulnerabilities table
merge_request: 44422
author: Borivoje Tasovac @borivojetasovac
type: performance
class RemoveProjectIdAndIdIndexFromVulnerabilitiesTable < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id'
disable_ddl_transaction!
def up
Gitlab::BackgroundMigration.steal('PopulateResolvedOnDefaultBranchColumn')
remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
end
def down
add_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
end
end
e25da3da50ed2396afe3bcb1ff441b5f1f0a43c0e23d66140a160d42f1b66a1a
\ No newline at end of file
...@@ -21764,8 +21764,6 @@ CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btre ...@@ -21764,8 +21764,6 @@ CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btre
CREATE INDEX index_vulnerabilities_on_project_id ON vulnerabilities USING btree (project_id); CREATE INDEX index_vulnerabilities_on_project_id ON vulnerabilities USING btree (project_id);
CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id);
CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id); CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id);
CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON vulnerabilities USING btree (start_date_sourcing_milestone_id); CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON vulnerabilities USING btree (start_date_sourcing_milestone_id);
......
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