summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-10-05 20:53:44 +0900
committerShinya Maeda <shinya@gitlab.com>2018-10-05 20:53:44 +0900
commit4b2f21dfaffed2960a70d2f242d3d7c8da2b92f1 (patch)
tree582eb1e4b840aeb157b0abf796e11da95a971662 /db/migrate
parentada45a7496971656af180f1790d61d75806361d2 (diff)
downloadgitlab-ce-4b2f21dfaffed2960a70d2f242d3d7c8da2b92f1.tar.gz
Change partial index's condition to make stale delayed builds removal a lot faster
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb b/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
index c2e62dede8a..81bf0d94e11 100644
--- a/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
+++ b/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
@@ -9,7 +9,7 @@ class AddPartialIndexToScheduledAt < ActiveRecord::Migration
disable_ddl_transaction!
def up
- add_concurrent_index(:ci_builds, [:scheduled_at, :id], where: "scheduled_at IS NOT NULL", name: INDEX_NAME)
+ add_concurrent_index(:ci_builds, :scheduled_at, where: "scheduled_at IS NOT NULL AND type = 'Ci::Build' AND status = 'scheduled'", name: INDEX_NAME)
end
def down