diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-12 18:09:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-12 18:09:26 +0000 |
commit | f4182abcb628e20978f011376811bbf8e644eff5 (patch) | |
tree | bb7886935855da9f69571b4970cfc5519dd40f2a /db | |
parent | 6cf30e964d54d536b0ff861916745f0a4bb31ebb (diff) | |
download | gitlab-ce-f4182abcb628e20978f011376811bbf8e644eff5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20201106134139_add_pipelines_created_index.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20201106134139 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 |
3 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20201106134139_add_pipelines_created_index.rb b/db/migrate/20201106134139_add_pipelines_created_index.rb new file mode 100644 index 00000000000..aaf6643cf0b --- /dev/null +++ b/db/migrate/20201106134139_add_pipelines_created_index.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddPipelinesCreatedIndex < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + INDEX_NAME = :index_ci_pipelines_on_project_id_and_status_and_created_at + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_pipelines, [:project_id, :status, :created_at], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_pipelines, INDEX_NAME + end +end diff --git a/db/schema_migrations/20201106134139 b/db/schema_migrations/20201106134139 new file mode 100644 index 00000000000..245cbbf712e --- /dev/null +++ b/db/schema_migrations/20201106134139 @@ -0,0 +1 @@ +9b1008df64741ad313ddf51969c18d609cd01a7255563fe0395d2bbf4d288e30
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index a7334cd10f2..ff62fdf84c1 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -20401,6 +20401,8 @@ CREATE INDEX index_ci_pipelines_on_project_id_and_source ON ci_pipelines USING b CREATE INDEX index_ci_pipelines_on_project_id_and_status_and_config_source ON ci_pipelines USING btree (project_id, status, config_source); +CREATE INDEX index_ci_pipelines_on_project_id_and_status_and_created_at ON ci_pipelines USING btree (project_id, status, created_at); + CREATE INDEX index_ci_pipelines_on_project_id_and_status_and_updated_at ON ci_pipelines USING btree (project_id, status, updated_at); CREATE INDEX index_ci_pipelines_on_project_id_and_user_id_and_status_and_ref ON ci_pipelines USING btree (project_id, user_id, status, ref) WHERE (source <> 12); |