Commit 5dacf976 authored by David Kim's avatar David Kim Committed by Alex Ives

Add updated_at index to improve Merge Request API performance

parent 27436a21
# frozen_string_literal: true
class AddUpdatedAtIndexOnMergeRequests < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
INDEX_NAME = 'index_merge_requests_on_target_project_id_and_updated_at_and_id'
disable_ddl_transaction!
def up
add_concurrent_index :merge_requests, [:target_project_id, :updated_at, :id], name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :merge_requests, INDEX_NAME
end
end
bd934c20443d5a044caa9e92389018291ffb2bf60b8ca54d9baca4a0e70caf28
\ No newline at end of file
......@@ -24179,6 +24179,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON
CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true));
CREATE INDEX index_merge_requests_on_target_project_id_and_updated_at_and_id ON merge_requests USING btree (target_project_id, updated_at, id);
CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text);
CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title);
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