Commit 97940f50 authored by Andreas Brandl's avatar Andreas Brandl

Add index for mirror_user_id to projects table

Related:
https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6589
parent 2eaf79fb
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190408163745) do
ActiveRecord::Schema.define(version: 20190423124640) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -2545,6 +2545,7 @@ ActiveRecord::Schema.define(version: 20190408163745) do
t.index ["last_repository_check_failed"], name: "index_projects_on_last_repository_check_failed", using: :btree
t.index ["last_repository_updated_at"], name: "index_projects_on_last_repository_updated_at", using: :btree
t.index ["mirror_last_successful_update_at"], name: "index_projects_on_mirror_last_successful_update_at", using: :btree
t.index ["mirror_user_id"], name: "index_projects_on_mirror_user_id", using: :btree
t.index ["name"], name: "index_projects_on_name_trigram", using: :gin, opclasses: {"name"=>"gin_trgm_ops"}
t.index ["namespace_id"], name: "index_projects_on_namespace_id", using: :btree
t.index ["path"], name: "index_projects_on_path", using: :btree
......
---
title: Add index for mirror_user_id to projects table
merge_request: 11422
author:
type: performance
# frozen_string_literal: true
class AddIndexToProjectsMirrorUserId < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :projects, :mirror_user_id
end
def down
remove_concurrent_index :projects, :mirror_user_id
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