Description
Shilen Patel @ Duke:
"This is regarding the membership queries we discussed in the call. Running Group.getMembers() in the API causes the following query to
execute once per each member.
Hibernate: select hibernatem0_.id as id, hibernatem0_.member_uuid as member_u2_, hibernatem0_.subject_id as subject_id, hibernatem0_.subject_source as subject_4_, hibernatem0_.subject_type as subject_5_ from grouper_members hibernatem0_ where
(hibernatem0_.member_uuid=? )"
Shilen Patel @ Duke:
"This is just a quick follow up to the previous email to mention how this operation can be improved. As mentioned before, if you want to run
Group.getMembers() on a group with 30,000 members, there will be 30,000 SELECT queries on the grouper_members table.
You can easily reduce that down to 1 query using a join like the following where you're getting all members in a specified group.
select m.id as id, m.member_uuid as member_u2_, m.subject_id as subject_id, m.subject_source as subject_4_, m.subject_type as subject_5_ from grouper_members m, grouper_memberships ms where owner_id=? and ms.list_name='members' and ms.list_type='list' and
ms.member_id = m.MEMBER_UUID"