diff options
author | Stan Hu <stanhu@gmail.com> | 2017-02-13 06:56:25 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-02-13 19:53:44 +0300 |
commit | 97739f15c73064ad56312f2cdc35a417985b6de4 (patch) | |
tree | 0f33c7ec2d10a4209ffbcfd4f98889deb47b6fdb /db | |
parent | edb8ed36cd5ce315ca45a047bd06ab1dfcf44203 (diff) |
Add indices to improve loading of labels page
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb | 12 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb b/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb new file mode 100644 index 00000000000..f922ed209aa --- /dev/null +++ b/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index d71911eaf14..feeea55ce9b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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", ["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| t.string "oid", null: false |