Commit 41661929 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'add-concurrent-index-resourcegroup-status-commitid' into 'master'

Add concurrent index resourcegroup status commitid

See merge request gitlab-org/gitlab!70911
parents 7cafd5ae f5fb3b4b
# frozen_string_literal: true
class ConcurrentIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id'
disable_ddl_transaction!
# Indexes were pre-created on gitlab.com to avoid slowing down deployments
# See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70279
# rubocop: disable Migration/PreventIndexCreation
def up
add_concurrent_index :ci_builds, [:resource_group_id, :status, :commit_id],
where: 'resource_group_id IS NOT NULL',
name: INDEX_NAME
end
# rubocop: enable Migration/PreventIndexCreation
def down
remove_concurrent_index_by_name :ci_builds, INDEX_NAME
end
end
6401de932d87b684c8a00254231312f8633c66a8ea96670b2761442c771d3d7f
\ No newline at end of file
......@@ -24439,6 +24439,8 @@ CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_bu
CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at);
CREATE INDEX index_ci_builds_on_resource_group_and_status_and_commit_id ON ci_builds USING btree (resource_group_id, status, commit_id) WHERE (resource_group_id IS NOT NULL);
CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC);
CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_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