diff options
author | Stan Hu <stanhu@gmail.com> | 2016-11-06 13:54:54 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-11-06 14:00:09 -0800 |
commit | a8f2fceadd60db759522c5669b99e68029df912e (patch) | |
tree | 46812b7e07cd513df851a34f72c7969d3b2c39e4 /db/migrate | |
parent | c392b0cc24ba40e3fed920c6c693cb24665193af (diff) | |
download | gitlab-ce-a8f2fceadd60db759522c5669b99e68029df912e.tar.gz |
Add an index for project_id in project_import_data to improveadd-project-import-data-index
performance
We see that many slow queries on GitLab.com are dominated by finding
the project import data for a specific project. Adding an index is
the most straightforward way of fixing this.
Closes #23748
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20161106185620_add_project_import_data_project_index.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20161106185620_add_project_import_data_project_index.rb b/db/migrate/20161106185620_add_project_import_data_project_index.rb new file mode 100644 index 00000000000..750a6a8c51e --- /dev/null +++ b/db/migrate/20161106185620_add_project_import_data_project_index.rb @@ -0,0 +1,12 @@ +class AddProjectImportDataProjectIndex < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_concurrent_index :project_import_data, :project_id + end +end |