Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-11-07 00:54:54 +0300
committerStan Hu <stanhu@gmail.com>2016-11-07 01:00:09 +0300
commita8f2fceadd60db759522c5669b99e68029df912e (patch)
tree46812b7e07cd513df851a34f72c7969d3b2c39e4 /db/migrate
parentc392b0cc24ba40e3fed920c6c693cb24665193af (diff)
Add an index for project_id in project_import_data to improve
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.rb12
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