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>2017-02-10 11:01:23 +0300
committerStan Hu <stanhu@gmail.com>2017-02-10 18:51:48 +0300
commit41d7b47c3cd3357269f967548428a768a606f0f0 (patch)
treea03ee968e503c6f3646e0f423f3317bb21a700c3 /db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb
parentb88e82ff0a1bca9687b5579208ba05a99e41a464 (diff)
Add index to ci_trigger_requests for commit_id
https://gitlab.com/gitlab-org/gitlab-ce/pipelines.json makes a number of unindexed slow queries. This index should speed things up.
Diffstat (limited to 'db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb')
-rw-r--r--db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb b/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb
new file mode 100644
index 00000000000..61e49c14fc0
--- /dev/null
+++ b/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb
@@ -0,0 +1,11 @@
+class AddIndexToCiTriggerRequestsForCommitId < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def change
+ add_concurrent_index :ci_trigger_requests, :commit_id
+ end
+end