Repository navigation
Conversation
guusdk
force-pushed
the
KEYCLOAK-19894_Remove-lowercase-userentity-username
branch
from
December 17, 2021 08:54
4f304d6 to
7a7be63
Compare
guusdk
force-pushed
the
KEYCLOAK-19894_Remove-lowercase-userentity-username
branch
from
January 10, 2022 10:36
7a7be63 to
002b5c7
Compare
Contributor
Author
|
I've rebased this on the current head of the main branch. |
guusdk
force-pushed
the
KEYCLOAK-19894_Remove-lowercase-userentity-username
branch
from
January 17, 2022 13:40
002b5c7 to
a21bf1d
Compare
…red value The values in the 'username' column of the 'user_entity' table are stored as lower-case values. When querying that column, the column value in a 'where' condition (unlike the provided search value) needs not be transformed to lower-case again (as it already is). With a transformation in place, indices cannot be used, which hurts performance. This commit removes the to-lower-case transformation of the 'username' column value on the 'user_entity' table.
The values in the 'username' column of the 'user_entity' table are stored as lower-case values. When querying that column, any input that contains anything but lowercase values will fail. The existing code-base seems to inconsistently transform input values to lower case. This commit adds to-lower-case transformations in places where that did not yet occur.
guusdk
force-pushed
the
KEYCLOAK-19894_Remove-lowercase-userentity-username
branch
from
February 21, 2022 14:17
a21bf1d to
83dd829
Compare
Contributor
Author
|
I've rebased this on the current head of the main branch, resolving a merge conflict with |
Contributor
Author
|
This is largely been resolved by #8893 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Values in the
usernamecolumn of theuser_entitydatabase table are stored there as lower-case values.When querying those values, the database-stored values should not be transformed to lower-case (by wrapping them in
lower()), because they already are lower-case. Converting them again prevents database indices from being used during execution of the query.Conversely, search query input values should be transformed to lower-case. Otherwise, the query is sure to not return any data if the input contains anything that isn't lower-case.
More context for this PR is provided in https://keycloak.discourse.group/t/code-change-suggestion-to-improve-performance-for-user-entity-lookups/ and https://issues.redhat.com/projects/KEYCLOAK/issues/KEYCLOAK-19894