[keycloak-dev] Reducing queries when initially loading a realm

Stian Thorgersen sthorger at redhat.com
Mon May 29 05:58:58 EDT 2017

When we initially load a realm there are a lot of queries going to the db.
A lot of things are fetched lazily which results a large number of queries.
For example to load roles see https://issues.jboss.org/browse/KEYCLOAK-4964.

How feasible would it be to have a single query that fetches most things
(if not everything) when a realm is initially loaded? We could at least
fetch all realm data including roles and composites, but excluding clients
and users.

More information about the keycloak-dev mailing list