Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040208Openbravo ERP09. Financial managementpublic2019-02-14 16:062019-03-28 14:56
joniturralde93 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
3.0PR18Q3.3 
3.0PR18Q3.33.0PR19Q2 
Sandrahuguet
Core
No
0040208: 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.
related to defect 0039171 closed Sandrahuguet Reset Accounting: performance problem executing unpost functionality with big database 
depends on backport 00402403.0PR19Q1 closed AtulOpenbravo Unpost process can be very slow 
depends on backport 00402413.0PR18Q4.2 closed AtulOpenbravo Unpost process can be very slow 
depends on backport 00402423.0PR18Q3.5 closed AtulOpenbravo Unpost process can be very slow 
? query (373) 2019-02-14 16:08
https://issues.openbravo.com/file_download.php?file_id=12658&type=bug
png beforefix.png (199,622) 2019-02-14 16:09
https://issues.openbravo.com/file_download.php?file_id=12659&type=bug
png

png afterfix.png (208,978) 2019-02-14 16:09
https://issues.openbravo.com/file_download.php?file_id=12660&type=bug
png
Issue History
2019-02-14 16:06joniturralde93New Issue
2019-02-14 16:06joniturralde93Assigned To => Triage Finance
2019-02-14 16:06joniturralde93Modules => Core
2019-02-14 16:06joniturralde93Resolution time => 1551913200
2019-02-14 16:06joniturralde93Triggers an Emergency Pack => No
2019-02-14 16:08joniturralde93File Added: query
2019-02-14 16:09joniturralde93File Added: beforefix.png
2019-02-14 16:09joniturralde93File Added: afterfix.png
2019-02-14 16:10joniturralde93Relationship addedrelated to 0039171
2019-02-14 17:34SandrahuguetAssigned ToTriage Finance => AtulOpenbravo
2019-02-14 17:58martinsdanIssue Monitored: martinsdan
2019-02-18 08:45AtulOpenbravoStatusnew => scheduled
2019-02-20 10:10AtulOpenbravoStatusscheduled => acknowledged
2019-02-20 10:11AtulOpenbravoStatusacknowledged => scheduled
2019-02-20 15:10hgbotCheckin
2019-02-20 15:10hgbotNote Added: 0109956
2019-02-20 15:10hgbotStatusscheduled => resolved
2019-02-20 15:10hgbotResolutionopen => fixed
2019-02-20 15:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4d918d964e2839b2e0d3cca3cad0400a395a7039 [^]
2019-02-20 15:11SandrahuguetReview Assigned To => Sandrahuguet
2019-02-20 15:11SandrahuguetNote Added: 0109959
2019-02-20 15:11SandrahuguetStatusresolved => closed
2019-02-20 15:11SandrahuguetFixed in Version => 3.0PR19Q2
2019-03-28 14:56hudsonbotCheckin
2019-03-28 14:56hudsonbotNote Added: 0110825

Notes
(0109956)
hgbot   
2019-02-20 15:10   
Repository: erp/devel/pi
Changeset: 4d918d964e2839b2e0d3cca3cad0400a395a7039
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Feb 20 09:46:02 2019 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/4d918d964e2839b2e0d3cca3cad0400a395a7039 [^]

Fixes Issue 0040208: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
---
(0109959)
Sandrahuguet   
2019-02-20 15:11   
Code review + testing OK
(0110825)
hudsonbot   
2019-03-28 14:56   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b2fbc1588df4 [^]
Maturity status: Test