From: Dave Greenberg Date: Tue, 8 Sep 2015 20:35:18 +0000 (-0700) Subject: CRM-16875 - reverse join order per Eileens comment. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cc55c60364b8121fd9e1af8456810411bb7178ae;p=civicrm-core.git CRM-16875 - reverse join order per Eileens comment. ---------------------------------------- * CRM-16875: Performance of finding contributions not in financial batch https://issues.civicrm.org/jira/browse/CRM-16875 --- diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index fd36887a70..cca022aa8a 100755 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -660,7 +660,8 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { $from = "civicrm_financial_trxn LEFT JOIN civicrm_entity_financial_trxn ON civicrm_entity_financial_trxn.financial_trxn_id = civicrm_financial_trxn.id -LEFT JOIN civicrm_entity_batch ON civicrm_entity_batch.entity_id = civicrm_financial_trxn.id +LEFT JOIN civicrm_entity_batch ON civicrm_entity_batch.entity_table = 'civicrm_financial_trxn' +AND civicrm_entity_batch.entity_id = civicrm_financial_trxn.id LEFT JOIN civicrm_contribution ON civicrm_contribution.id = civicrm_entity_financial_trxn.entity_id LEFT JOIN civicrm_financial_type ON civicrm_financial_type.id = civicrm_contribution.financial_type_id LEFT JOIN civicrm_contact contact_a ON contact_a.id = civicrm_contribution.contact_id