Create means to either directly create index or log SQL command to create index conditionally, based on number of current records in a table.
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.
- 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