Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-22

Excessive Group member queries

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 1.2.1
    • 1.2.0
    • API
    • None

    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"

      Attachments

        Activity

          People

            blair.christensen@at.internet2.edu Blair Christensen
            blair.christensen@at.internet2.edu Blair Christensen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: