Commit d1c71c7c authored by Douglas Barbosa Alexandre's avatar 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
parents 917f04ff 5bb2f0c6
---
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment