提交 d1c71c7c 编写于 作者: D Douglas Barbosa Alexandre

Merge branch 'sh-add-index-extern-uid' into 'master'

Add partial index on identities table to speed up LDAP lookups

Closes #59630

See merge request gitlab-org/gitlab-ce!26710
---
title: Add partial index on identities table to speed up LDAP lookups
merge_request: 26710
author:
type: performance
# frozen_string_literal: true
class AddIndexOnIdentitiesLowerExternUidAndProvider < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
INDEX_NAME = "index_on_identities_lower_extern_uid_and_provider"
def up
add_concurrent_index(:identities, 'lower(extern_uid), provider', name: INDEX_NAME)
end
def down
remove_concurrent_index_by_name(:identities, INDEX_NAME)
end
end
......@@ -1580,6 +1580,7 @@ ActiveRecord::Schema.define(version: 2019_07_29_090456) do
t.datetime "updated_at"
t.integer "saml_provider_id"
t.string "secondary_extern_uid"
t.index "lower((extern_uid)::text), provider", name: "index_on_identities_lower_extern_uid_and_provider"
t.index ["saml_provider_id"], name: "index_identities_on_saml_provider_id", where: "(saml_provider_id IS NOT NULL)"
t.index ["user_id"], name: "index_identities_on_user_id"
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册