diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-08-08 13:18:37 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-08-08 13:18:37 +0000 |
commit | 6f21652f0b79a614ad809dc028aaa28aee16732e (patch) | |
tree | 591441e9db6047314918e4c9fc8d7b8fe30a880e | |
parent | 27f5efcfa50232cd2b81e3ced503adbf1bb8823c (diff) | |
parent | db0d75ea3e533dec746ee75c964ee4951d38761c (diff) | |
download | gitlab-ce-6f21652f0b79a614ad809dc028aaa28aee16732e.tar.gz |
Merge branch 'ci-builds-status-index' into 'master'
Remove redundant ci_builds (status) index
See merge request gitlab-org/gitlab-ce!21070
-rw-r--r-- | changelogs/unreleased/ci-builds-status-index.yml | 5 | ||||
-rw-r--r-- | db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb | 17 | ||||
-rw-r--r-- | db/schema.rb | 3 |
3 files changed, 23 insertions, 2 deletions
diff --git a/changelogs/unreleased/ci-builds-status-index.yml b/changelogs/unreleased/ci-builds-status-index.yml new file mode 100644 index 00000000000..8b7252f09e5 --- /dev/null +++ b/changelogs/unreleased/ci-builds-status-index.yml @@ -0,0 +1,5 @@ +--- +title: Remove redundant ci_builds (status) index +merge_request: 21070 +author: +type: performance diff --git a/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb b/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb new file mode 100644 index 00000000000..f4f7cb6f8ca --- /dev/null +++ b/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveRedundantStatusIndexOnCiBuilds < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + remove_concurrent_index :ci_builds, :status + end + + def down + add_concurrent_index :ci_builds, :status + end +end diff --git a/db/schema.rb b/db/schema.rb index c132f787530..f1d8f4df3b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180726172057) do +ActiveRecord::Schema.define(version: 20180807153545) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -346,7 +346,6 @@ ActiveRecord::Schema.define(version: 20180726172057) do add_index "ci_builds", ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)", using: :btree add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree - add_index "ci_builds", ["status"], name: "index_ci_builds_on_status", using: :btree add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree add_index "ci_builds", ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree |