Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
admin/api
Describe the bug
There seems to be a performance regression when fetching child groups via admin API.
We have a group with ~1250 subgroups. In 25.0.6 I used to be able to do the following:
GET https://KEYCLOAK/auth/admin/realms/REALM/groups/GROUPID/children?max=-1
and it would return in a few 10s of ms.
If I do the same on 26.2.4 it takes ~5 seconds. We're not using any of the new features in 26.2.4, the setup is a simple straight migration from v25.
The subgroups do have attributes (in case that affects performance).
Version
26.2.4
Regression
- The issue is a regression
Expected behavior
GET https://KEYCLOAK/auth/admin/realms/REALM/groups/GROUPID/children?max=-1
should be fast (10s of ms) even for groups with ~1250 children.
Actual behavior
GET https://KEYCLOAK/auth/admin/realms/REALM/groups/GROUPID/children?max=-1
Takes ~5 seconds for groups with 1250 children.
How to Reproduce?
Create group with 1250 subgroups, fetch all children of the group at once.
Anything else?
Tested with one or multiple replicas, with our without infinispan, the result is the same.
Pure speculation: My suspicion is that v26 executes a DB query for every group returned (in my case 1250 queries) and v25 didn't, which would explain the performance hit.