Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.3.1
-
Fix Version/s: 3.4.alpha
-
Component/s: Core CiviCRM
-
Labels:None
Description
I was having a heck-of-a-time importing a CSV file containing two contacts into a CiviCRM installation that already has 700k contacts. The import took > 15mins!
http://forum.civicrm.org/index.php/topic,18246.0.html
Doing some PHP profiling revealed the following:
- PEAR DB is kinda crappy for performance. The tiny fix in this patch improved performance by ~20%. Reading through the code tells me that there are several other performance problems.
- The import script is needlessly rebuilding the ACL cache both before and after the import, even if ACLs are not in use. This patch checks if ACLs are in use just like how it's done in CRM_Contact_BAO_Contact_Permission->cacheClause().
- The ACL cache in general needs an architectural overhaul. The implementation can not scale beyond a few hundred contacts. This patch does not delve into that.