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

Optimze Relationship Count on Contact Summary View

    Details

    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      Yes

      Description

      Contacts with a lot of relationships (over 5000) take a lot of time to load.  This is because the count of relationships is being done by fetching ALL records of relationships associated to the contact from the Database, putting them into an array, and then counting the number of elements in the array.

      This is the problematic code:

      https://github.com/civicrm/civicrm-core/blob/4.7.19/CRM/Contact/BAO/Contact.php#L2573-L2579

      This problem was also reported in CRM-6628.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Miya27 Camilo Rodriguez
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified