diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-23 14:35:24 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-23 14:35:24 +0000 |
commit | 7e662dc7cba5440ba21a0a928f035914c48bce37 (patch) | |
tree | 640c7b2e58593a8d108cde5b18245f99516502a0 /db/migrate | |
parent | a77b40d45e2f474a3d2401125b7b89379a7a7dd5 (diff) | |
parent | 22d6f96cf982765fa9b957905248a573c6e3c498 (diff) | |
download | gitlab-ce-7e662dc7cba5440ba21a0a928f035914c48bce37.tar.gz |
Merge branch '26570-optimize-latest-pipeline-query' into 'master'
Optimize Ci::Pipeline.latest query
Closes #26570
See merge request !9306
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb | 10 | ||||
-rw-r--r-- | db/migrate/20170216141440_drop_index_for_builds_project_status.rb | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb b/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb new file mode 100644 index 00000000000..7b1e687977b --- /dev/null +++ b/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb @@ -0,0 +1,10 @@ +class AddIndexForLatestSuccessfulPipeline < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_concurrent_index(:ci_commits, [:gl_project_id, :ref, :status]) + end +end diff --git a/db/migrate/20170216141440_drop_index_for_builds_project_status.rb b/db/migrate/20170216141440_drop_index_for_builds_project_status.rb new file mode 100644 index 00000000000..906711b9f3f --- /dev/null +++ b/db/migrate/20170216141440_drop_index_for_builds_project_status.rb @@ -0,0 +1,8 @@ +class DropIndexForBuildsProjectStatus < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + DOWNTIME = false + + def change + remove_index(:ci_commits, [:gl_project_id, :status]) + end +end |