Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-2349

Slow user query by attribute [GHI#12671]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Describe the bug

      If querying users by attribute values the response is really slow.

      On further investigation the query is missing the database index because attribute name and value is queried by lower value, eg. lower(name) and lower(value).

      Either remove lower and match the actual value (which seems to be the more reasonable approach) or add a matching new index to the attribute table:
      ``` CREATE INDEX index ON user_attribute(lower(name), lower(value)); ```

          1. Version

      18.0.1

          1. Expected behavior

      Query by attribute returns in a reasonable time.

          1. Actual behavior

      Query takes really long and produces a lot of load on the database.

          1. How to Reproduce?

      Just query by attribute.

          1. Anything else?

      Adding a max value to the query totally breaks the request. (Timeouts)

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Core IAM
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: