Commit 305ee993 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch 'ab-count-pending-mirror-updates' into 'master'

Add index to count pending mirror updates

Closes gitlab-ce#62419

See merge request gitlab-org/gitlab-ee!13901
parents 4444fb49 1f9c3955
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190530154715) do
ActiveRecord::Schema.define(version: 20190603124955) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -2454,6 +2454,7 @@ ActiveRecord::Schema.define(version: 20190530154715) do
t.datetime_with_timezone "last_successful_update_at"
t.index ["jid"], name: "index_project_mirror_data_on_jid", using: :btree
t.index ["last_successful_update_at"], name: "index_project_mirror_data_on_last_successful_update_at", using: :btree
t.index ["last_update_at", "retry_count"], name: "index_project_mirror_data_on_last_update_at_and_retry_count", using: :btree
t.index ["next_execution_timestamp", "retry_count"], name: "index_mirror_data_on_next_execution_and_retry_count", using: :btree
t.index ["project_id"], name: "index_project_mirror_data_on_project_id", unique: true, using: :btree
t.index ["status"], name: "index_project_mirror_data_on_status", using: :btree
......
---
title: Add index to count pending mirror updates
merge_request: 13901
author:
type: performance
# frozen_string_literal: true
class AddIndexToCountPendingMirrorUpdates < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :project_mirror_data, [:last_update_at, :retry_count]
end
def down
remove_concurrent_index :project_mirror_data, [:last_update_at, :retry_count]
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment