Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3031

CRM_Contact_BAO_GroupNesting::hasParentGroups() makes too many queries

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      In CRM_Contact_BAO_GroupNesting::hasParentGroups(), we look for the parent groups of $groupId.

      With many groups, this produces a huge number of queries against the table civicrm_group_nesting. The sample logfile attached shows 2591 lines of logfile (>1200 queries perhaps).

      For nested sets like this, it might be more efficient to load the entire contents of that table at once and store it in memory, rather than repeating the query many times.

        Attachments

          Activity

            People

            • Assignee:
              amit Amiteshwar Prasad
              Reporter:
              xurizaemon Chris Burgess
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: