Commit a98f5bdd authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'coverage_fuzzing_usage_ping_secure_index' into 'master'

Add index for coverage fuzzing usage data

See merge request gitlab-org/gitlab!39569
parents 006bcac2 2ff5f6f8
---
title: Add secure index for coverage fuzzing
merge_request: 39569
author:
type: performance
# frozen_string_literal: true
class UpdateIndexSecureForCoverageFuzzingTelemetry < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
OLD_SECURE_INDEX_NAME = 'index_secure_ci_builds_on_user_id_created_at'
NEW_SECURE_INDEX_NAME = 'index_secure_ci_builds_on_user_id_created_at_parser_features'
def up
add_concurrent_index(:ci_builds,
[:user_id, :created_at],
where: "(((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('secret_detection'::character varying)::text])))",
name: NEW_SECURE_INDEX_NAME)
remove_concurrent_index_by_name :ci_builds, OLD_SECURE_INDEX_NAME
end
def down
add_concurrent_index(:ci_builds,
[:user_id, :created_at],
where: "(((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text])))",
name: OLD_SECURE_INDEX_NAME)
remove_concurrent_index_by_name :ci_builds, NEW_SECURE_INDEX_NAME
end
end
6776d7a401c1c56bd64a5585d123ba5aaba612348d66d4f8704530c5e8cc4f2d
\ No newline at end of file
......@@ -20669,7 +20669,7 @@ CREATE UNIQUE INDEX index_scim_identities_on_user_id_and_group_id ON public.scim
CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypted ON public.scim_oauth_access_tokens USING btree (group_id, token_encrypted);
CREATE INDEX index_secure_ci_builds_on_user_id_created_at ON public.ci_builds USING btree (user_id, created_at) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text])));
CREATE INDEX index_secure_ci_builds_on_user_id_created_at_parser_features ON public.ci_builds USING btree (user_id, created_at) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('secret_detection'::character varying)::text])));
CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON public.ci_builds USING btree (name, id) WHERE (((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text));
......
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