summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 09:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 09:09:34 +0000
commit97f0ae7454597105a27df65ffb772949d9d4f3cb (patch)
tree0bf4888e0e9082c8f168a211390a73a6ae810cef /db
parent5ebc4d92cd5fbb46c627eb04d500384893dbe2b4 (diff)
downloadgitlab-ce-97f0ae7454597105a27df65ffb772949d9d4f3cb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200408175424_add_index_on_creator_id_created_at_id_to_projects_table.rb17
-rw-r--r--db/structure.sql3
2 files changed, 20 insertions, 0 deletions
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
\.