From 97f0ae7454597105a27df65ffb772949d9d4f3cb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 14 Apr 2020 09:09:34 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- ...dex_on_creator_id_created_at_id_to_projects_table.rb | 17 +++++++++++++++++ db/structure.sql | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 db/migrate/20200408175424_add_index_on_creator_id_created_at_id_to_projects_table.rb (limited to 'db') diff --git a/db/migrate/20200408175424_add_index_on_creator_id_created_at_id_to_projects_table.rb b/db/migrate/20200408175424_add_index_on_creator_id_created_at_id_to_projects_table.rb new file mode 100644 index 00000000000..70df38aea17 --- /dev/null +++ b/db/migrate/20200408175424_add_index_on_creator_id_created_at_id_to_projects_table.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnCreatorIdCreatedAtIdToProjectsTable < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, [:creator_id, :created_at, :id] + end + + def down + remove_concurrent_index :projects, [:creator_id, :created_at, :id] + end +end diff --git a/db/structure.sql b/db/structure.sql index 622234396a2..895afed92e6 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9884,6 +9884,8 @@ CREATE INDEX index_projects_on_created_at_and_id ON public.projects USING btree 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_description_trigram ON public.projects USING gin (description public.gin_trgm_ops); CREATE INDEX index_projects_on_id_and_archived_and_pending_delete ON public.projects USING btree (id) WHERE ((archived = false) AND (pending_delete = false)); @@ -13092,5 +13094,6 @@ COPY "schema_migrations" (version) FROM STDIN; 20200407094005 20200407094923 20200408110856 +20200408175424 \. -- cgit v1.2.1