Commit fe13d053 authored by James Johnson's avatar James Johnson

Adds index for vulnerability findings

parent 135889dd
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddIdxVulnerabilityOccurrencesDedup < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
TABLE = :vulnerability_occurrences
INDEX_NAME = 'index_vulnerability_occurrences_deduplication'
COLUMNS = %i[project_id report_type project_fingerprint]
disable_ddl_transaction!
def up
add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME
end
def down
remove_concurrent_index TABLE, COLUMNS, name: INDEX_NAME
end
end
71cea758ecb70049468531f70c52aec021060cd48e58155de0ba118786562ac6
\ No newline at end of file
...@@ -23990,6 +23990,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON ...@@ -23990,6 +23990,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON
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_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text)); CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text));
CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id);
--- ---
title: Eager load vulnerabilities for better database performance title: Pipline vulnerabilities loading performance improvements
merge_request: 55692 merge_request: 55692
author: author:
type: performance type: performance
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