Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing lower index on users table - needed for postgres #1662

Closed
strehle opened this issue Sep 9, 2021 · 1 comment · Fixed by #1663
Closed

Missing lower index on users table - needed for postgres #1662

strehle opened this issue Sep 9, 2021 · 1 comment · Fixed by #1663
Labels
accepted Accepted the issue performance
Milestone

Comments

@strehle
Copy link
Member

strehle commented Sep 9, 2021

What version of UAA are you running?

75.7.0 , develop

How are you deploying the UAA?

I am deploying the UAA

  • locally only using gradlew

What did you do?

Executed a SQL manually because we had a postgres issue in bigger landscapes
Example

select count from users where ((LOWER(username) = LOWER('mariassa') and LOWER(identity_zone_id) = LOWER('uaa')))

With a DB ide you can execute

EXPLAIN ANALYZE select count from users where ((LOWER(username) = LOWER('mariassa') and LOWER(identity_zone_id) = LOWER('uaa')))

What did you expect to see? What goal are you trying to achieve with the UAA?

Expected is an indexed scan in the query plan to ensure that we run with the index

What did you see instead?

Sequenced scan is done because we have no lower index on idz and origin, see
https://github.com/cloudfoundry/uaa/blob/develop/server/src/main/resources/org/cloudfoundry/identity/uaa/db/postgresql/V2_0_4__Identity_Provider_Adjustments.sql#L27

Reason found in git log

dca40d9

This is an issue on postgres, on mysql I think no issue, because found serveral similar issues, see
https://github.com/cloudfoundry/uaa/search?q=index+lower&type=issues

@strehle strehle added this to the 75.8.0 milestone Sep 9, 2021
@strehle
Copy link
Member Author

strehle commented Sep 9, 2021

@torsten-sap FYI

strehle added a commit that referenced this issue Sep 13, 2021
@strehle strehle linked a pull request Sep 13, 2021 that will close this issue
strehle added a commit that referenced this issue Sep 14, 2021
* fix issue #1662

* add files for hdb and mysql

simply to have same version as latest in folder
@cf-gitbot cf-gitbot added delivered accepted Accepted the issue and removed delivered labels Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted the issue performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants