[keycloak-user] Slow API Search for User Due to Wildcard

Josh Harness joshua.k.harness at gmail.com
Tue May 22 18:42:24 EDT 2018


Hi -

      We're using this API to search for users by email:

           https://www.keycloak.org/docs-api/4.0/rest-api/index.
html#_users_resource

      It looks like it does the following in a SQL database:

        * Issues a "lower" function call on the search criteria
        * Bookends the query criteria with wildcards, eg '%'

      The lower function breaks the index. Our DBA's worked around this
with a function based index in Oracle. However, the second wildcard is
causing the entire table to be read (1,000,000 records) and is impacting
performance.

      Does anybody have any ideas about how to load users without the
wildcard when you only know the username or email address? We know the the
exact username or email. Our use case doesn't require the wild card search.

Thanks!

Josh


More information about the keycloak-user mailing list