Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031772Openbravo ERP04. Warehouse managementpublic2015-12-24 10:162016-07-20 11:34
VictorVillar 
aferraz 
immediatemajoralways
closedfixed 
5
 
3.0PR16Q23.0PR16Q2 
dmiguelez
Core
No
0031772: Performance problem when you try to validate the costing rule with high volume of data
Performance problem when you try to validate the costing rule with high volume of data. Around 6000000 transactions
Try to validate the Costing Rule defining an starting date and having 6000000 warehouse transactions.

The process takes so long, more than 24 hours.
No tags attached.
related to defect 00320123.0PR16Q2 closed aferraz Not possible to either validate a costing rule or create an inventory amount update under some circumstancies 
depends on defect 00320363.0PR16Q2 closed aferraz API Change Request: Change m_transaction_trg to avoid execute m_update_inventory when costing related columns are updated 
related to defect 00334113.0PR17Q1 closed dmiguelez Bad performance Costing Background process using 3 types of adjustments 
related to defect 0036612 new Triage Omni WMS Improve performance of costing rule validation process 
causes defect 0033937 closed markmm82 Error in Costing Background Process if first costing rule validated with starting date,previous transactions cost not calculated 
Issue History
2015-12-24 10:16VictorVillarNew Issue
2015-12-24 10:16VictorVillarAssigned To => Triage Finance
2015-12-24 10:16VictorVillarModules => Core
2015-12-24 10:16VictorVillarResolution time => 1421362800
2015-12-24 10:16VictorVillarTriggers an Emergency Pack => No
2015-12-24 10:17VictorVillarIssue Monitored: networkb
2015-12-28 12:56VictorVillarResolution time1421362800 => 1452898800
2016-01-07 12:39aferrazAssigned ToTriage Finance => aferraz
2016-01-07 13:10aferrazStatusnew => scheduled
2016-01-28 10:41aferrazRelationship addeddepends on 0032036
2016-01-29 14:59aferrazRelationship addedrelated to 0032012
2016-02-09 12:41hgbotCheckin
2016-02-09 12:41hgbotNote Added: 0084052
2016-02-09 12:41hgbotStatusscheduled => resolved
2016-02-09 12:41hgbotResolutionopen => fixed
2016-02-09 12:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4e9e547d819903e9983b718935144d2c6db4c395 [^]
2016-02-09 12:42dmiguelezReview Assigned To => dmiguelez
2016-02-09 12:42dmiguelezNote Added: 0084053
2016-02-09 12:42dmiguelezStatusresolved => closed
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085121
2016-07-20 11:26aferrazRelationship addedrelated to 0033411
2016-07-20 11:34aferrazFixed in Version => 3.0PR16Q2
2016-09-12 18:56aferrazRelationship addedcauses 0033937
2017-08-04 14:23aferrazRelationship addedrelated to 0036612

Notes
(0084052)
hgbot   
2016-02-09 12:41   
Repository: erp/devel/pi
Changeset: 4e9e547d819903e9983b718935144d2c6db4c395
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jan 28 09:24:21 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4e9e547d819903e9983b718935144d2c6db4c395 [^]

Fixes issue 31772: Improve performance in Costing Rule validation

Update M_TRANSACTION_TRG to execute M_UPDATE_INVENTORY only when updated columns are not related to costing (like transactioncost, m_costing_algorithm_id, iscostcalculated, c_currency_id, costing_status, isprocessed, checkpricedifference, manualcostadjustment and iscostpermanent).
Update some methods in CostingRuleProcess and CostingRuleProcessOnProcessHandler to use query.uniqueResult() != null instead of query.count() > 0.
Update initializeOldTrx method in CostingRuleProcess to do an insert and an update in hql instead of doing a loop in java.
Change second loop in updateInventoriesCostAndProcessInitInventories method in CostingRuleProcess to use a scroll instead of looping over a list.
Use new getInventoryLineTransactions method in CostingRuleProcess instead of getInventoryLineTransaction method, which returns a scroll.
Use trx.getPhysicalInventoryLine().getRelatedInventory() instead of getInitIcl(cri.getInitInventory(), icl) in CostingRuleProcess.
Change updateInitInventoriesTrxDate method in CostingRuleProcess to do an update in hql instead of doing a loop in java.

---
M src-db/database/model/triggers/M_TRANSACTION_TRG.xml
M src/org/openbravo/costing/CostingMigrationProcess.java
M src/org/openbravo/costing/CostingRuleProcess.java
M src/org/openbravo/costing/CostingRuleProcessOnProcessHandler.java
---
(0084053)
dmiguelez   
2016-02-09 12:42   
Code Review + Testing Ok
(0085121)
hudsonbot   
2016-03-17 10: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/b22fb0500156 [^]
Maturity status: Test