Commit 91c971bf authored by Yorick Peterse's avatar Yorick Peterse

Index project_group_links.group_id

This column is used when refreshing authorizations and without the
index leads to a sequence scan being performed on this table.
parent 53250d6d
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddIndexProjectGroupLinksGroupId < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :project_group_links, :group_id
end
def down
remove_concurrent_index :project_group_links, :group_id
end
end
......@@ -925,6 +925,8 @@ ActiveRecord::Schema.define(version: 20170508190732) do
t.date "expires_at"
end
add_index "project_group_links", ["group_id"], name: "index_project_group_links_on_group_id", using: :btree
create_table "project_import_data", force: :cascade do |t|
t.integer "project_id"
t.text "data"
......
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