Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043416Openbravo ERP04. Warehouse managementpublic2020-03-04 14:342020-03-04 14:35
shuehner 
Triage Omni WMS 
normalminorhave not tried
newopen 
5
 
 
Core
No
0043416: PL-function m_get_product_cost could be made 2 * faster
This pl-function checks twice in m_costing table:
a.) First to see if there are any rows in the matching range
b.) Then querying again to fetch the first interesting rows.

In practice that doubles runtime compared to only doing a single query.

Attached files (of OLD 2.50 version of the pl) show idea of this change.

Pending to check:
1.) The date filters are not identical between the 2 checks. The 'BETWEEN' usage filters for <= DATETO while the fetching query does < DATETO
That should be still fine as the 'shortcut count(*) is less restrictive' so the 2nd query should still return the correct result

2.) Recent change added extra filter condition:
17092: AND costtype NOT IN ('AVA' , 'STA')
to make it 'not costing new engine costs'.
That should be probably added instead to the 2nd query

3.) That change 17092 is unclear if totally correct today. While it does exclude AVA,STA from the shortcut query it will not filter those out when retrieving data.

-
No tags attached.
related to design defect 0022417 new Triage Omni OMS The Pareto Product Legacy reports takes long to show a big amount of data 
? m_get_product_cost-original.sql (2,725) 2020-03-04 14:34
https://issues.openbravo.com/file_download.php?file_id=14136&type=bug
? m_get_product_cost-new.sql (2,457) 2020-03-04 14:34
https://issues.openbravo.com/file_download.php?file_id=14137&type=bug
Issue History
2020-03-04 14:34shuehnerNew Issue
2020-03-04 14:34shuehnerAssigned To => Triage Finance
2020-03-04 14:34shuehnerModules => Core
2020-03-04 14:34shuehnerTriggers an Emergency Pack => No
2020-03-04 14:34shuehnerFile Added: m_get_product_cost-original.sql
2020-03-04 14:34shuehnerFile Added: m_get_product_cost-new.sql
2020-03-04 14:35shuehnerNote Added: 0118322
2020-03-04 18:17shuehnerRelationship addedrelated to 0022417

Notes
(0118322)
shuehner   
2020-03-04 14:35   
Note: Issue is mostly reported to see if that improvement is still relevant / interesting with current 3.0 code.