[keycloak-dev] 5111x SQL Executions

John D. Ament john.d.ament at gmail.com
Fri Nov 10 14:58:53 EST 2017


Hi,

So we've nailed down most of our performance issues (figured out why
caching was off as well).  We're seeing that the last call that's
struggling is the whoami call.  We see 5k SQL executions for the following
query: 5,111 × select userrolema0_.ROLE_ID as col_0_0_ from
USER_ROLE_MAPPING userrolema0_ where userrolema0_.USER_ID=?

I've put together a gist of the request/response to better highlight what I
believe the issue is.  Basically, for every realm and every role the user
has, one query is executed.  This data isn't loaded from the cache for some
reason.  I'm wondering if for role mapping does it make sense to simply
load all of them for a given user?

Gist: https://gist.github.com/johnament/e2be3ba7bda695b014caa695ebffdd61

John


More information about the keycloak-dev mailing list