Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037653Retail ModulesWeb POSpublic2018-01-17 10:142019-12-09 15:00
aferraz 
ranjith_qualiantech_com 
normalmajorhave not tried
closedfixed 
5
 
RR20Q1 
marvintm
No
0037653: Performance problem in PaidReceipts
Performance problem in PaidReceipts
Process takes around 50 ms.
If you call this process many many times (to generate the JSON of orders stored in database), it will take many hours:
1,000,000 records * 50 ms. = 50,000,000 ms. = 13.88 hours.

Attached yourkit snapshot.
Following query is taking most of the time: PaidReceipts.java:323.
Subquery inside it is almost the same as the query run just before in PaidReceipts.java:304.
It seems subquery in line 323 could be replaced by the result of query in line 304.
No tags attached.
related to defect 0042385 closed rqueralta Performance improvement in PaidReceipts query 
html PaidReceipts.html (56,185) 2018-01-17 10:14
https://issues.openbravo.com/file_download.php?file_id=11461&type=bug
zip PaidReceipts.snapshot.zip (1,674,857) 2018-01-17 10:16
https://issues.openbravo.com/file_download.php?file_id=11462&type=bug
patch issue 37653 source posterminal.patch (2,891) 2018-03-28 08:14
https://issues.openbravo.com/file_download.php?file_id=11687&type=bug
Issue History
2018-01-17 10:14aferrazNew Issue
2018-01-17 10:14aferrazAssigned To => Retail
2018-01-17 10:14aferrazTriggers an Emergency Pack => No
2018-01-17 10:14aferrazFile Added: PaidReceipts.html
2018-01-17 10:16aferrazFile Added: PaidReceipts.snapshot.zip
2018-01-17 11:10aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16543#r16543
2018-01-29 08:56aferrazProposed Solution updated
2018-03-26 14:57ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2018-03-26 14:57ranjith_qualiantech_comStatusnew => scheduled
2018-03-28 08:14ranjith_qualiantech_comFile Added: issue 37653 source posterminal.patch
2018-04-05 07:52hgbotCheckin
2018-04-05 07:52hgbotNote Added: 0103680
2018-04-05 07:52hgbotStatusscheduled => resolved
2018-04-05 07:52hgbotResolutionopen => fixed
2018-04-05 07:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/dcbcd845f19ac1ab4f58d76cd7365a5175dd5440 [^]
2018-04-16 18:09marvintmNote Added: 0103915
2018-04-16 18:09marvintmStatusresolved => new
2018-04-16 18:09marvintmResolutionfixed => open
2018-04-23 13:10ranjith_qualiantech_comStatusnew => scheduled
2018-06-26 14:03hgbotCheckin
2018-06-26 14:03hgbotNote Added: 0105453
2019-12-07 08:11ranjith_qualiantech_comRelationship addedrelated to 0042385
2019-12-07 08:11ranjith_qualiantech_comNote Added: 0116135
2019-12-07 08:11ranjith_qualiantech_comStatusscheduled => resolved
2019-12-07 08:11ranjith_qualiantech_comResolutionopen => fixed
2019-12-09 15:00marvintmReview Assigned To => marvintm
2019-12-09 15:00marvintmStatusresolved => closed
2019-12-09 15:00marvintmFixed in Version => RR20Q1

Notes
(0103680)
hgbot   
2018-04-05 07:52   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: dcbcd845f19ac1ab4f58d76cd7365a5175dd5440
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Apr 05 11:22:21 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/dcbcd845f19ac1ab4f58d76cd7365a5175dd5440 [^]

Fixed issue 37653 : Refactored PaidReceipts for Performance problem

---
M src/org/openbravo/retail/posterminal/PaidReceipts.java
---
(0103915)
marvintm   
2018-04-16 18:09   
There are several problems with the current solution:

- Concatenation of strings in this way is a potential problem of hql injection
- Too many values passed like this may cause a problem in Oracle
- Not clear why the change would improve the performance in this case, and the commit message doesn't explain it.
(0105453)
hgbot   
2018-06-26 14:03   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 78efe957658de849054997b779a73b9ba4ebfe47
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Jun 26 17:32:51 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/78efe957658de849054997b779a73b9ba4ebfe47 [^]

Related to issue 37653 : Backed out changeset: dcbcd845f19a

* Changes are not enough to fix the perfomance issues.

---
M src/org/openbravo/retail/posterminal/PaidReceipts.java
---
(0116135)
ranjith_qualiantech_com   
2019-12-07 08:11   
Fixed in https://issues.openbravo.com/view.php?id=42385 [^]