Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036368Openbravo ERP07. Sales managementpublic2017-06-28 12:552017-06-29 13:03
eduardo_Argal 
Triage Omni OMS 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q3 
vmromanos
Core
No
0036368: Performance problem in C_Invoice_Post
C_Incoice_Post procedure has poor performance requiring more than a second to process an invoice
Using a big database (in this case the big machine used to improve performance) the processing of an invoice takes more than a second.
The problem is when using get_calendarowner function inside a query. Find attached the pacth with the proposed solution. This turns performance to 0.29 sec
Performance
diff performance_C_INVOICE_POST.diff (1,927) 2017-06-28 12:55
https://issues.openbravo.com/file_download.php?file_id=10877&type=bug
Issue History
2017-06-28 12:55eduardo_ArgalNew Issue
2017-06-28 12:55eduardo_ArgalAssigned To => Triage Finance
2017-06-28 12:55eduardo_ArgalFile Added: performance_C_INVOICE_POST.diff
2017-06-28 12:55eduardo_ArgalModules => Core
2017-06-28 12:55eduardo_ArgalResolution time => 1499810400
2017-06-28 12:55eduardo_ArgalTriggers an Emergency Pack => No
2017-06-28 14:49vmromanosStatusnew => scheduled
2017-06-28 17:29vmromanosNote Added: 0097741
2017-06-29 07:37hgbotCheckin
2017-06-29 07:37hgbotNote Added: 0097748
2017-06-29 07:37hgbotStatusscheduled => resolved
2017-06-29 07:37hgbotResolutionopen => fixed
2017-06-29 07:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1a7aad006212c5ca48944ddb74f47e184b29b8bb [^]
2017-06-29 07:37vmromanosReview Assigned To => vmromanos
2017-06-29 07:37vmromanosNote Added: 0097749
2017-06-29 07:37vmromanosStatusresolved => closed
2017-06-29 07:37vmromanosFixed in Version => 3.0PR17Q3
2017-06-29 09:42SandrahuguetTag Attached: Performance
2017-06-29 13:03hudsonbotCheckin
2017-06-29 13:03hudsonbotNote Added: 0097763

Notes
(0097741)
vmromanos   
2017-06-28 17:29   
Test plan I:
As Openbravo admin
Go to purchase invoice window
Create a new record for organization España Norte.
Select any business partner and enter any line.
Complete the invoice. Verify the process is completed successfully.
Reactivate the invoice. Verify the process is completed successfully.
Complete the invoice again and void it. Verify the process is completed successfully.

Test plan II:
As Openbravo admin
Go to purchase invoice window
Create a new record for organization España.
Select any business partner and enter any line.
Complete the invoice. Verify the process is completed successfully.
Reactivate the invoice. Verify the process is completed successfully.
Complete the invoice again and void it. Verify the process is completed successfully.

Test plan III:
As Openbravo admin
Go to sales invoice window
Create a new record for organization España Norte.
Select any business partner and enter any line.
Complete the invoice. Verify the process is completed successfully.
Reactivate the invoice. Verify the process is completed successfully.
Complete the invoice again and void it. Verify the process is completed successfully.

Test plan IV:
As Openbravo admin
Go to sales invoice window
Create a new record for organization España.
Select any business partner and enter any line.
Complete the invoice. Verify the process is completed successfully.
Reactivate the invoice. Verify the process is completed successfully.
Complete the invoice again and void it. Verify the process is completed successfully.
(0097748)
hgbot   
2017-06-29 07:37   
Repository: erp/devel/pi
Changeset: 1a7aad006212c5ca48944ddb74f47e184b29b8bb
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Jun 28 14:57:06 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1a7aad006212c5ca48944ddb74f47e184b29b8bb [^]

Fixed issue 36368: Performance problem in C_Invoice_Post

Changeset pushed on behalf of EAR

AD_ORG_GETCALENDAROWNER function was creating performance problems in queries related to high volume tables, as it was evaluated per each record.
Solution extracts the function call in a separate query that is executed just one time.
The result is passed to the where clause using a variable thus improving performance.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
---
(0097749)
vmromanos   
2017-06-29 07:37   
Code review + testing OK
(0097763)
hudsonbot   
2017-06-29 13:03   
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/d271753746bb [^]
Maturity status: Test