Details
-
Type:
Improvement
-
Status: Done/Fixed
-
Priority:
Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.3.6
-
Fix Version/s: 3.4.5
-
Component/s: Core CiviCRM
-
Labels:None
Description
The getTags() method in Tag.php uses recursion to build the tag hierarchy. The problem with this is that many unnecessary queries are generated on the civicrm_tag table as the function performs its recursion.
We have implemented a new version of Tag.php which makes a single query to grab the contents of the civicrm_tag table, and we build the tree after iterating over the results.
This cuts down on literally hundreds of queries per HTTP request for any tag-related operations.
I am attaching the new version of Tag.php to this ticket.
The full path to the file is custom/php/CRM/Core/BAO/Tag.php