Commit 07480d53 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch...

Merge branch '325605-query-performance-investigation-4458344713234267000-select-merge_requests-from' into 'master'

Add additional index to merge_request for project/status/created_at

See merge request gitlab-org/gitlab!57267
parents 916190b0 bf9a9b96
---
title: Add additional index to merge_requests table for project/status/created_at
merge_request: 57267
author:
type: performance
# frozen_string_literal: true
class AddProjectStatusDateIndexToMergeRequests < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = "idx_mrs_on_target_id_and_created_at_and_state_id"
disable_ddl_transaction!
def up
add_concurrent_index :merge_requests, %i[target_project_id state_id created_at id], name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :merge_requests, INDEX_NAME
end
end
9ee014f462ec0d2affaab146243fb991298e9b30bd57b741fba0440b1676de03
\ No newline at end of file
......@@ -21706,6 +21706,8 @@ CREATE UNIQUE INDEX idx_metrics_users_starred_dashboard_on_user_project_dashboar
CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_commit_diff_files USING btree (merge_request_context_commit_id, sha);
CREATE INDEX idx_mrs_on_target_id_and_created_at_and_state_id ON merge_requests USING btree (target_project_id, state_id, created_at, id);
CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name);
CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url);
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