Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.6, 4.4.0, 4.4.6
-
Fix Version/s: 4.4.7
-
Component/s: CiviReport
-
Labels:
-
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)