Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.3.6
-
Fix Version/s: 4.1.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
The Contact Permission cache function currently fetches rows, groups them by self::NUM_CONTACTS_TO_INSERT, and does buffered bulk REPLACE INTO queries.
This patch pushes that work into the database by embedding the SELECT statement into an INSERT query and buffering the INSERTS using the LIMIT and OFFSET functions. The REPLACE aspect of the job is handled by the ON DUPLICATE UPDATE clause which, instead of dropping the old and inserting the new, updates the values in place in the table.
This improved functionality requires MySQL 5.1 or greater.