Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 3.4.7, 4.0.7
-
Fix Version/s: None
-
Component/s: CiviCRM Search
-
Labels:None
Description
the advanced search may at times generate some inefficient queries due to the inclusion of unnecessary tables. for example –
searching "on hold = 1" renders the following query:
http://paste2.org/p/1801333
searching "on hold = 1 AND email = %" renders the following query:
http://paste2.org/p/1801332
in neither case do we need the address table.
in the second case there's a double join on the email table and an unnecessary join on the location_type table. the latter join creates duplicate ids. they are later removed through a distinct select, but are thus inefficient.