[APRM] Fixes issue 15871: improve performace modulescript CreateAccountingConfiguration
authorMikel Irurita <mikel.irurita@openbravo.com>
Mon, 07 Mar 2011 10:16:23 +0100
changeset 11045 7da8e24d6950
parent 11044 fc7ec1644bf0
child 11048 02969a07da5c
[APRM] Fixes issue 15871: improve performace modulescript CreateAccountingConfiguration
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.class
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfiguration_data.xsql
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.java
src-db/database/model/tables/C_PERIODCONTROL.xml
Binary file modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.class has changed
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfiguration_data.xsql	Mon Mar 07 09:37:30 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfiguration_data.xsql	Mon Mar 07 10:16:23 2011 +0100
@@ -70,7 +70,6 @@
             and c_periodcontrol.docbasetype = ad_ref_list.value
             and c_periodcontrol.ad_org_id = a.ad_org_id)
       group by c_period.ad_client_id, c_period.c_period_id, ad_ref_list.value, a.ad_org_id
-      order by c_period.c_period_id, ad_ref_list.value, a.ad_org_id
       ]]>
     </Sql>
   </SqlMethod>
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.java	Mon Mar 07 09:37:30 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/CreateAccountingConfigurationData.java	Mon Mar 07 10:16:23 2011 +0100
@@ -213,8 +213,7 @@
       "            where c_periodcontrol.c_period_id = c_period.c_period_id" +
       "            and c_periodcontrol.docbasetype = ad_ref_list.value" +
       "            and c_periodcontrol.ad_org_id = a.ad_org_id)" +
-      "      group by c_period.ad_client_id, c_period.c_period_id, ad_ref_list.value, a.ad_org_id" +
-      "      order by c_period.c_period_id, ad_ref_list.value, a.ad_org_id";
+      "      group by c_period.ad_client_id, c_period.c_period_id, ad_ref_list.value, a.ad_org_id";
 
     int updateCount = 0;
     PreparedStatement st = null;
--- a/src-db/database/model/tables/C_PERIODCONTROL.xml	Mon Mar 07 09:37:30 2011 +0100
+++ b/src-db/database/model/tables/C_PERIODCONTROL.xml	Mon Mar 07 10:16:23 2011 +0100
@@ -62,6 +62,11 @@
       <foreign-key foreignTable="AD_ORG" name="C_PERIODCONTROL_AD_ORG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <index name="C_PERIODCONTROL_DOCBASE" unique="false">
+        <index-column name="C_PERIOD_ID"/>
+        <index-column name="DOCBASETYPE"/>
+        <index-column name="AD_ORG_ID"/>
+      </index>
       <index name="C_PERIODCONTROL_PERIOD" unique="false">
         <index-column name="C_PERIOD_ID"/>
       </index>