diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-10 13:41:22 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-20 18:28:13 +0300 |
commit | 5be8f03747eff470e3093e6a3f97c475ddba9a90 (patch) | |
tree | 02f675d7f8f439e5925df46f40d2f0c7b8d2a374 /db | |
parent | c89449e6110c2bdf6e1410bae3e7b7d807c5e305 (diff) |
Improve performance of User Agent Detail
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170210103609_add_index_to_user_agent_detail.rb | 14 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20170210103609_add_index_to_user_agent_detail.rb b/db/migrate/20170210103609_add_index_to_user_agent_detail.rb new file mode 100644 index 00000000000..c01753cfbd2 --- /dev/null +++ b/db/migrate/20170210103609_add_index_to_user_agent_detail.rb @@ -0,0 +1,14 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddIndexToUserAgentDetail < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_concurrent_index(:user_agent_details, [:subject_id, :subject_type]) + end +end diff --git a/db/schema.rb b/db/schema.rb index e0208dab3d3..88aaa6c3c55 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1218,6 +1218,8 @@ ActiveRecord::Schema.define(version: 20170215200045) do t.datetime "updated_at", null: false end + add_index "user_agent_details", ["subject_id", "subject_type"], name: "index_user_agent_details_on_subject_id_and_subject_type", using: :btree + create_table "users", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false |