Commit 20d1bda1 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch '213800-remove-redundant-index-from-projects' into 'master'

Remove redundant index on creator_id and created_at from projects

See merge request gitlab-org/gitlab!29507
parents da46b9ff 772fee38
---
title: Remove redundant index from projects table
merge_request: 29507
author:
type: performance
# frozen_string_literal: true
class RemoveIndexProjectsOnCreatorIdAndCreatedAtFromProjects < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_projects_on_creator_id_and_created_at'
disable_ddl_transaction!
def up
remove_concurrent_index_by_name :projects, INDEX_NAME
end
def down
add_concurrent_index :projects, [:creator_id, :created_at], name: INDEX_NAME
end
end
...@@ -9927,8 +9927,6 @@ CREATE INDEX index_projects_api_vis20_updated_at ON public.projects USING btree ...@@ -9927,8 +9927,6 @@ CREATE INDEX index_projects_api_vis20_updated_at ON public.projects USING btree
CREATE INDEX index_projects_on_created_at_and_id ON public.projects USING btree (created_at, id); CREATE INDEX index_projects_on_created_at_and_id ON public.projects USING btree (created_at, id);
CREATE INDEX index_projects_on_creator_id_and_created_at ON public.projects USING btree (creator_id, created_at);
CREATE INDEX index_projects_on_creator_id_and_created_at_and_id ON public.projects USING btree (creator_id, created_at, id); CREATE INDEX index_projects_on_creator_id_and_created_at_and_id ON public.projects USING btree (creator_id, created_at, id);
CREATE INDEX index_projects_on_creator_id_and_id ON public.projects USING btree (creator_id, id); CREATE INDEX index_projects_on_creator_id_and_id ON public.projects USING btree (creator_id, id);
...@@ -13178,6 +13176,7 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -13178,6 +13176,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200408175424 20200408175424
20200409211607 20200409211607
20200410232012 20200410232012
20200414144547
20200415160722 20200415160722
20200415161021 20200415161021
20200415161206 20200415161206
......
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