-
Notifications
You must be signed in to change notification settings - Fork 840
Description
We are using UAA version: 77.10.0
We are on MYSQL DB: 8.0.mysql_aurora.3.05.2
In ScimUserEndpoint.java, we fetch complete user data from RDS, for given identity_zone_id.
Case 1:
In findUsers() -> syncGroup() -> getGroupsWithMember() → we again fetch the user data from RDS.
Problem: This looks like repeated query on Database.
Can we have a check, before checking in DB for users, that if this user was already fetched from last query, we will avoid querying on User table again.
And only in case the user is coming from another transitive group, we can have this check.
Case 2:
Similarly, in same flow, we fetch default user groups for user.
getDefaultUserGroups(),
Problem: Again this query is being performed repeatedly on Database. For 100 users, 100 times for 1 request.
Whereas the default groups remains same for an identity zone.
Case 3:
We already have index as "CREATE UNIQUE INDEX group_membership_unique_key ON group_membership (member_id,group_id);"
However for below example of query:
SELECT g.id, g.displayName, g.description, g.created, g.lastModified, g.version, g.identity_zone_id
FROM groups g, group_membership gm
WHERE gm.group_id = g.id
AND gm.identity_zone_id = g.identity_zone_id
AND gm.identity_zone_id = 'my_identity_zone'
AND gm.member_id IN ('my_user_id');
The above query is giving us performance issues, so it may require another composite index as below:
CREATE INDEX idx_group_membership_zone_member_group
ON group_membership (identity_zone_id, member_id, group_id);
Can we analyze the performance of this query and add any composite index if required?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status