Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-11908

Support for conditional creating indices based on number of records

    XMLWordPrintable

    Details

    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      What

      Create means to either directly create index or log SQL command to create index conditionally, based on number of current records in a table.

      Why

      Database schema lacks several indices that would significantly improve query performance.
      While it is tempting to just introduce indices in a Liquibase changeset, creating an index on huge tables with millions of records (e.g. table containing events) can easily take huge amount of time and potentially change major service disruption on upgrades. Hence creation of the indices could be done automatically only if the number of records is small enough to be really fast, or performed by an administrator asynchronously during the least disruptive period while Keycloak is already upgraded and running. To help the administrator with the latter, exact SQL command should be logged.

      Concerns

      • Should the index be created by administrator, the message needs to be logged every time Keycloak starts.
      • The threshold for automated index creation should be configurable, likely by an entry within the connectionsLiquibase spi configuration

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              hmlnarik@redhat.com Hynek Mlnařík
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: