[EE] Add partial index on identities table to speed up LDAP lookups
For customers with thousands of entries in the table, lookups for an LDAP identity dominated the PostgreSQL statistics because of sequential scans. We can speed this up by adding a partial index with the extern_uid and provider.
CE port: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26710
Edited by Stan Hu