Commit 572fb0be authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'sh-add-index-for-label-count' into 'master'

Add index to labels for `type` and project_id`

Closes #27676

See merge request !8978
parents 4d11903d 1e97a6df
class AddIndexToLabelsForTypeAndProject < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def change
add_concurrent_index :labels, [:type, :project_id]
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170130204620) do
ActiveRecord::Schema.define(version: 20170204181513) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -576,6 +576,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do
end
add_index "labels", ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true, using: :btree
add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree
create_table "lfs_objects", force: :cascade do |t|
t.string "oid", null: false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment