Ejegg has submitted this change and it was merged.

Change subject: Add index to civicrm_financial_item
......................................................................


Add index to civicrm_financial_item

(Depends on patch to civicrm repo).

Add an index to improve performance in an upgrade-proof manner

Change-Id: I8a865c99a3212b0fa8a3985078bc5d0d701d2451
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 19 insertions(+), 0 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 4e3a7d8..0204d85 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -45,6 +45,7 @@
     wmf_civicrm_update_7063();
     wmf_civicrm_update_7064();
     wmf_civicrm_update_7080();
+    wmf_civicrm_update_7090();
 }
 
 /**
@@ -1651,3 +1652,21 @@
   $tables = array('civicrm_financial_trxn' => array('trxn_id'));
   CRM_Core_BAO_SchemaHandler::createIndexes($tables);
 }
+
+/**
+ * T122947 add index to civicrm_financial item.
+ *
+ * The existing one does not start with entity_id so the queries that omit
+ * entity_table dont' use it. It is also logically the wrong way around as the
+ * one with more variation should lead.
+ *
+ * The upstream patch (CRM-17775) removes indexes as well. I have not ported 
that part
+ * back at this stage as I'm viewing it as tidy up rather than a performance
+ * fix and leaving 4.7.2 upgrade to catch it.
+ */
+function wmf_civicrm_update_7090() {
+  civicrm_initialize();
+  CRM_Core_BAO_SchemaHandler::createIndexes(array(
+    'civicrm_financial_item' => array(array('entity_id', 'entity_table')),
+  ));
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/268052
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a865c99a3212b0fa8a3985078bc5d0d701d2451
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to