Commit 26b89a55 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Add compound index for `vulnerabilities` table on `project_id` and `id`

Changelog: performance
parent c9faf2ba
# frozen_string_literal: true
class AddCompoundIndexOnProjectIdAndIdForVulnerabilities < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id'
disable_ddl_transaction!
def up
add_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
end
def down
remove_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
end
end
6f3a3712288c3316042426d60f087817eb57a3246b750831aa72f95f30269a5d
\ No newline at end of file
......@@ -27951,6 +27951,8 @@ CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING
CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id);
CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id);
CREATE INDEX index_vulnerabilities_on_project_id_and_state_and_severity ON vulnerabilities USING btree (project_id, state, severity);
CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_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