Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-10 18:13:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-10 18:13:21 +0300
commit26881dd926cfac47c9603d44e8d5a504ab8c4a14 (patch)
tree32d0543691630448b1b2a624bdae41ead6bcc7fc /db
parent419966e5d34a98d89354ed658c33478ce02d8017 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb17
-rw-r--r--db/schema_migrations/202111031620251
-rw-r--r--db/structure.sql2
3 files changed, 20 insertions, 0 deletions
diff --git a/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb b/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb
new file mode 100644
index 00000000000..a8ef8e51e8c
--- /dev/null
+++ b/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0]
+ INDEX_NAME = 'index_events_on_created_at_and_id'
+ TABLE = :events
+ COLUMNS = %i[created_at id]
+ CONSTRAINTS = "created_at > '2021-08-27 00:00:00+00'::timestamp with time zone"
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS
+ end
+
+ def down
+ remove_concurrent_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS
+ end
+end
diff --git a/db/schema_migrations/20211103162025 b/db/schema_migrations/20211103162025
new file mode 100644
index 00000000000..e6cb01358d4
--- /dev/null
+++ b/db/schema_migrations/20211103162025
@@ -0,0 +1 @@
+2ed9198926eb0579fccd4a8b1866f10ba4f42683d676e0664db3fadefe0bed39 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 619b0cbcf03..a109953a827 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -25853,6 +25853,8 @@ CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events U
CREATE INDEX index_events_on_author_id_and_project_id ON events USING btree (author_id, project_id);
+CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone);
+
CREATE INDEX index_events_on_group_id_partial ON events USING btree (group_id) WHERE (group_id IS NOT NULL);
CREATE INDEX index_events_on_project_id_and_created_at ON events USING btree (project_id, created_at);