details: https://code.openbravo.com/erp/devel/pi/rev/873ec13e7f74 changeset: 31563:873ec13e7f74 user: Víctor Martínez Romanos <victor.martinez <at> openbravo.com> date: Fri Feb 24 14:36:27 2017 +0100 summary: Fixed bug 35287: Slow behavior in Financial Account | Accounting tab
Added new index to improve query performance. In the customer environment the total cost has been reduced from 6581196 to 1310605, and the query time from 18 seconds to 1.2 seconds. The index is declared as partial index because, although the null ratio is going to be low (around 10% in real instances), it is very unlikely to search by "is null" in this column. So we can have a (small) benefit in declaring as partial index (faster inserts/deletes/updates when the column is null). diffstat: src-db/database/model/tables/FACT_ACCT.xml | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diffs (14 lines): diff -r a393f7e134d6 -r 873ec13e7f74 src-db/database/model/tables/FACT_ACCT.xml --- a/src-db/database/model/tables/FACT_ACCT.xml Fri Feb 24 13:26:11 2017 +0100 +++ b/src-db/database/model/tables/FACT_ACCT.xml Fri Feb 24 14:36:27 2017 +0100 @@ -302,6 +302,10 @@ <index name="FACT_ACCT_GROUP" unique="false"> <index-column name="FACT_ACCT_GROUP_ID"/> </index> + <index name="FACT_ACCT_LINE_ID" unique="false"> + <index-column name="LINE_ID"/> + <whereClause><![CDATA[LINE_ID IS NOT NULL]]></whereClause> + </index> <index name="FACT_ACCT_RECORD_ID2" unique="false"> <index-column name="RECORD_ID2"/> </index> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits