Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040241Openbravo ERP09. Financial managementpublic2019-02-14 16:062019-02-20 15:27
joniturralde93 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
3.0PR18Q3.3 
3.0PR18Q4.23.0PR18Q4.2 
Sandrahuguet
Core
No
0040241: Unpost process can be very slow
In a customer instance with a lot of data in FACT_ACCT, the queries are too slow when filtering by record_id.
Attached query from ResetAccounting (getDocbasetypes method) which makes the process slow.

Also attached explain analyze before and after our proposed solution.
In customer environment:

1. Go to goods shipment.
2. Unpost a record.
3. Process time can vary, but sometimes can easily take 30-60 mins

Almost all the time consumed by the attached query.

CREATE INDEX FACT_ACCT_RECORDID ON FACT_ACCT(recordid);
No tags attached.
blocks defect 00402083.0PR18Q3.3 closed AtulOpenbravo Unpost process can be very slow 
Issue History
2019-02-20 10:11AtulOpenbravoTypedefect => backport
2019-02-20 10:11AtulOpenbravoTarget Version3.0PR18Q3.3 => 3.0PR18Q4.2
2019-02-20 15:26hgbotCheckin
2019-02-20 15:26hgbotNote Added: 0109960
2019-02-20 15:26hgbotStatusscheduled => resolved
2019-02-20 15:26hgbotResolutionopen => fixed
2019-02-20 15:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR18Q4.2/rev/bf5f0343dba5aa733d8e7c74d9ee9461621a6daf [^]
2019-02-20 15:27SandrahuguetReview Assigned To => Sandrahuguet
2019-02-20 15:27SandrahuguetNote Added: 0109961
2019-02-20 15:27SandrahuguetStatusresolved => closed
2019-02-20 15:27SandrahuguetFixed in Version => 3.0PR18Q4.2

Notes
(0109960)
hgbot   
2019-02-20 15:26   
Repository: erp/backports/3.0PR18Q4.2
Changeset: bf5f0343dba5aa733d8e7c74d9ee9461621a6daf
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Feb 20 09:46:02 2019 +0530
URL: http://code.openbravo.com/erp/backports/3.0PR18Q4.2/rev/bf5f0343dba5aa733d8e7c74d9ee9461621a6daf [^]

Fixes Issue 0040241:Unpost process can be very slow

To use existing index fact_acct_table_record_id for
ad_table_id and record_id columns of fact_acct, ad_table_id
is added in AND clause of exists subquery from fact_acct
table only if record id is sent to getDocbasetypes method.

---
M src/org/openbravo/financial/ResetAccounting.java
---
(0109961)
Sandrahuguet   
2019-02-20 15:27   
Code review + testing OK