Add indices to improve loading of labels page
This commit is contained in:
parent
edb8ed36cd
commit
97739f15c7
3 changed files with 18 additions and 0 deletions
4
changelogs/unreleased/sh-add-labels-index.yml
Normal file
4
changelogs/unreleased/sh-add-labels-index.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Add indices to improve loading of labels page
|
||||||
|
merge_request:
|
||||||
|
author:
|
|
@ -0,0 +1,12 @@
|
||||||
|
class AddIndexToLabelsForTitleAndProject < ActiveRecord::Migration
|
||||||
|
include Gitlab::Database::MigrationHelpers
|
||||||
|
|
||||||
|
DOWNTIME = false
|
||||||
|
|
||||||
|
disable_ddl_transaction!
|
||||||
|
|
||||||
|
def change
|
||||||
|
add_concurrent_index :labels, :title
|
||||||
|
add_concurrent_index :labels, :project_id
|
||||||
|
end
|
||||||
|
end
|
|
@ -581,6 +581,8 @@ ActiveRecord::Schema.define(version: 20170210075922) do
|
||||||
|
|
||||||
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", ["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
|
add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree
|
||||||
|
add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
|
||||||
|
add_index "labels", ["title"], name: "index_labels_on_title", using: :btree
|
||||||
|
|
||||||
create_table "lfs_objects", force: :cascade do |t|
|
create_table "lfs_objects", force: :cascade do |t|
|
||||||
t.string "oid", null: false
|
t.string "oid", null: false
|
||||||
|
|
Loading…
Reference in a new issue