Commit 1d408874 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch...

Merge branch '344084-create-index-on-vulnerability_occurrence_pipelines-to-speed-up-vulnerability-report' into 'master'

Add an index on vulnerability_occurrence_pipelines

See merge request gitlab-org/gitlab!73255
parents 7a503767 a09fb11d
# frozen_string_literal: true
class AddOccurrenceIdIdDescIndexToVulnerabilityOccurrencePipelines < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
INDEX_NAME = "index_vulnerability_occurrence_pipelines_occurrence_id_and_id"
def up
add_concurrent_index(
:vulnerability_occurrence_pipelines,
[:occurrence_id, :id],
order: { id: :desc },
name: INDEX_NAME
)
end
def down
remove_concurrent_index_by_name(
:vulnerability_occurrence_pipelines,
INDEX_NAME
)
end
end
ed6939c1e89f78290c312bf005cb33bd1a5ee778e8d9be3ae2eb04cc25416b92
\ No newline at end of file
...@@ -27058,6 +27058,8 @@ CREATE INDEX index_vulnerability_occurrence_identifiers_on_identifier_id ON vuln ...@@ -27058,6 +27058,8 @@ CREATE INDEX index_vulnerability_occurrence_identifiers_on_identifier_id ON vuln
CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON vulnerability_occurrence_identifiers USING btree (occurrence_id, identifier_id); CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON vulnerability_occurrence_identifiers USING btree (occurrence_id, identifier_id);
CREATE INDEX index_vulnerability_occurrence_pipelines_occurrence_id_and_id ON vulnerability_occurrence_pipelines USING btree (occurrence_id, id DESC);
CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id); CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id);
CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occurrences USING btree (project_id, report_type, project_fingerprint); CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occurrences USING btree (project_id, report_type, project_fingerprint);
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