Openbravo Issue Tracking System - Retail Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0033625 | Retail Modules | Web POS | public | 2016-08-04 14:17 | 2016-08-18 09:18 |
Reporter | shuehner | ||||
Assigned To | mtaal | ||||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | migueldejuana | ||||
OBNetwork customer | No | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0033625: (Order|Invoice|Cahsup)ImportEntryProcessor countEntries has bad performance with many rows in c_import_entry | ||||
Description | Those processors do some functional pre-checks to delay processing of a row if some related rows are still pending to be processed. I.e. delay cashup until all 'its' orders+invoices have been processed. The current code forces an exact select count(*) of all pending rows when it only needs 'are there any rows'. By rewriting that code the query can be made a lot faster by letting the db stop processing after a single matching row has been found. | ||||
Steps To Reproduce | Current code: select count(*) from C_IMPORT_ENTRY c_import_e0_ where c_import_e0_.ImportStatus='Initial' and (c_import_e0_.Typeofdata='Order' or c_import_e0_.Typeofdata='OBPOS_Invoice' or c_import_e0_.Typeofdata='FIN_Finacc_Transaction' or c_import_e0_.Typeofdata='OBPOS_App_Cashup') and c_import_e0_.Created<now() and c_import_e0_.EM_Obpos_Applications_ID='73B564E1CE044A618E033BD5EF636F46' and c_import_e0_.C_IMPORT_ENTRY_ID<>'E1C1635' Explain analyze of postgres with db having huge import entry backlog: Limit (cost=820959.69..820959.70 rows=1 width=0) (actual time=548.171..548.171 rows=1 loops=1) =================== new code select 1 from C_IMPORT_ENTRY c_import_e0_ where c_import_e0_.ImportStatus='Initial' and (c_import_e0_.Typeofdata='Order' or c_import_e0_.Typeofdata='OBPOS_Invoice' or c_import_e0_.Typeofdata='FIN_Finacc_Transaction' or c_import_e0_.Typeofdata='OBPOS_App_Cashup') and c_import_e0_.Created<now() and c_import_e0_.EM_Obpos_Applications_ID='73B564E1CE044A618E033BD5EF636F46' and c_import_e0_.C_IMPORT_ENTRY_ID<>'E1C1635' limit 1; Explain in same env: Limit (cost=0.00..2.28 rows=1 width=0) (actual time=0.016..0.016 rows=1 loops=1) | ||||
Proposed Solution | |||||
Additional Information | |||||
Tags | Performance | ||||
Relationships | |||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=9677&type=bug ![]() https://issues.openbravo.com/file_download.php?file_id=9688&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2016-08-04 14:17 | shuehner | New Issue | |||
2016-08-04 14:17 | shuehner | Assigned To | => Retail | ||
2016-08-04 14:17 | shuehner | OBNetwork customer | => No | ||
2016-08-04 14:17 | shuehner | Triggers an Emergency Pack | => No | ||
2016-08-04 14:18 | shuehner | Tag Attached: Performance | |||
2016-08-04 14:18 | shuehner | File Added: 33625_prototype.diff | |||
2016-08-04 14:20 | shuehner | Note Added: 0088820 | |||
2016-08-07 10:08 | mtaal | Assigned To | Retail => mtaal | ||
2016-08-07 12:01 | mtaal | File Added: 33625.diff | |||
2016-08-08 12:43 | hgbot | Checkin | |||
2016-08-08 12:43 | hgbot | Note Added: 0088883 | |||
2016-08-08 12:43 | hgbot | Status | new => resolved | ||
2016-08-08 12:43 | hgbot | Resolution | open => fixed | ||
2016-08-08 12:43 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/99c6f8f71b500fcb1ea967aba5bccbccefe07bc9 [^] | ||
2016-08-08 12:44 | mtaal | Review Assigned To | => migueldejuana | ||
2016-08-18 09:18 | migueldejuana | Note Added: 0089200 | |||
2016-08-18 09:18 | migueldejuana | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|