Details
- 
    Type:Improvement 
- 
    Status: Done/Fixed
- 
    Priority:Major 
- 
    Resolution: Fixed/Completed
- 
    Affects Version/s: 1.5
- 
    Fix Version/s: 1.6
- 
    Component/s: None
- 
    Labels:None
Description
Fixed conditions should never be in the ON clause of a JOIN.
Example fixed conditions:
civicrm_location.entity_table = 'civicrm_contact'
civicrm_email.is_primary = 1
civicrm_location.is_primary = 1
These are all in the ON clause of their JOINs. The queries will speed up immensely if you move them to where the they belong, the WHERE clause.