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

Member Report (Detail) locks in DB with large membership/contribution sets

    Details

    • Documentation Required?:
      None

      Description

      We have a larger set of memberships/contributions than most (probably about a million combined), and this causes the Member Report (Detail) to run a query that ends up locking MySQL.

      We were able to trade the main problem to the fact that there's a subquery join for handling member_payment and contribution, and MySQL has very bad performance when joining subqueries. I split the subquery out into separate joins and added the order field as a conditional order to the Member Report Detail template. Patched file attached (it's been renamed from Detail.php to DetailFixed.php and tested by using it as a custom template)

        Attachments

        1. DetailDiff.txt
          1 kB
          Rob Williams
        2. DetailFixed.php
          17 kB
          Rob Williams

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              duwease Rob Williams
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: