diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-12-03 23:47:52 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-12-04 21:22:47 +0800 |
commit | 3cf48699f787181b742932dae63ef072f8b25b2a (patch) | |
tree | 2c05d1daa44a4bbfef9e902fbbcb131db06297ff | |
parent | 77f215b3f4feaab49f9d10975554b8c866e865f9 (diff) | |
download | gitlab-ce-53989-53993-remove-redundant-indices.tar.gz |
Remove redundant index on project_mirror_data on GitLab.com53989-53993-remove-redundant-indices
-rw-r--r-- | changelogs/unreleased/53989-53993-remove-redundant-indices.yml | 5 | ||||
-rw-r--r-- | db/migrate/20181203154104_remove_redundant_index_for_project_mirror_data.rb | 30 | ||||
-rw-r--r-- | db/schema.rb | 2 |
3 files changed, 36 insertions, 1 deletions
diff --git a/changelogs/unreleased/53989-53993-remove-redundant-indices.yml b/changelogs/unreleased/53989-53993-remove-redundant-indices.yml new file mode 100644 index 00000000000..effede598de --- /dev/null +++ b/changelogs/unreleased/53989-53993-remove-redundant-indices.yml @@ -0,0 +1,5 @@ +--- +title: Remove index for next_execution_timestamp on project_mirror_data +merge_request: 23512 +author: +type: performance diff --git a/db/migrate/20181203154104_remove_redundant_index_for_project_mirror_data.rb b/db/migrate/20181203154104_remove_redundant_index_for_project_mirror_data.rb new file mode 100644 index 00000000000..c739826f106 --- /dev/null +++ b/db/migrate/20181203154104_remove_redundant_index_for_project_mirror_data.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveRedundantIndexForProjectMirrorData < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + remove_concurrent_index(*index_on_project_mirror_data) + end + + def down + add_concurrent_index(*index_on_project_mirror_data) + end + + private + + def index_on_project_mirror_data + [ + :project_mirror_data, + [:next_execution_timestamp], + { name: 'index_project_mirror_data_on_next_execution_timestamp' } + ] + end +end diff --git a/db/schema.rb b/db/schema.rb index 995619bdc69..167bf05a40f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20181126153547) do +ActiveRecord::Schema.define(version: 20181203154104) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" |