Merge branch 'add-project-import-data-index' into 'master'

Add an index for project_id in project_import_data to improve

See merge request !7316
This commit is contained in:
Yorick Peterse 2016-11-07 11:06:35 +00:00
commit 717b8a7692
3 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,4 @@
---
title: Add an index for project_id in project_import_data to improve performance
merge_request:
author:

View file

@ -0,0 +1,12 @@
class AddProjectImportDataProjectIndex < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def change
add_concurrent_index :project_import_data, :project_id
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161103171205) do ActiveRecord::Schema.define(version: 20161106185620) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -867,6 +867,8 @@ ActiveRecord::Schema.define(version: 20161103171205) do
t.string "encrypted_credentials_salt" t.string "encrypted_credentials_salt"
end end
add_index "project_import_data", ["project_id"], name: "index_project_import_data_on_project_id", using: :btree
create_table "projects", force: :cascade do |t| create_table "projects", force: :cascade do |t|
t.string "name" t.string "name"
t.string "path" t.string "path"