Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033411Openbravo ERP04. Warehouse managementpublic2016-07-01 14:252016-12-16 18:38
VictorVillar 
dmiguelez 
immediatecriticalalways
closedfixed 
5
 
3.0PR17Q13.0PR17Q1 
aferraz
Core
No
0033411: Bad performance Costing Background process using 3 types of adjustments
Bad performance Costing Background process using 3 types of adjustments
Bad performance Costing Background process using 3 types of adjustments: Backdated, Price Cost Correction, Negative Stock correction.

This query is taking more than 1.5 seconds:

2016-07-01 04:21:54 CDT LOG: duration: 1699.337 ms execute S_18203/C_18204: select max(materialmg0_.MovementDate) as col_0_0_ from M_Transaction materialmg0_ where materialmg0_.IsCostCalculated='Y' and (materialmg0_.AD_Org_ID in ($1))
No tags attached.
related to defect 00325043.0PR16Q3 closed aferraz Huge performance problem in the costing background process and using the Negative stock correction too 
related to defect 00317723.0PR16Q2 closed aferraz Performance problem when you try to validate the costing rule with high volume of data 
related to defect 00320233.0PR16Q2 closed aferraz CostingUtils.getCurrentValuedStock method consumes unneeded memory 
related to defect 00321903.0PR16Q2 closed aferraz Performance problems on the PriceDifferenceBackground process 
related to defect 00324583.0PR16Q2 closed markmm82 It is necessary to add log information in process executed when Validating Costing Rule 
depends on backport 00339943.0PR16Q3.3 closed dmiguelez Bad performance Costing Background process using 3 types of adjustments 
depends on backport 00341893.0PR16Q4 closed dmiguelez Bad performance Costing Background process using 3 types of adjustments 
related to defect 00339683.0PR17Q1 closed dmiguelez Wrong costs calculated with Backdated Transactions 
Issue History
2016-07-01 14:25VictorVillarNew Issue
2016-07-01 14:25VictorVillarAssigned To => Triage Finance
2016-07-01 14:25VictorVillarModules => Core
2016-07-01 14:25VictorVillarResolution time => 1467928800
2016-07-01 14:25VictorVillarTriggers an Emergency Pack => No
2016-07-01 14:28ngarciaIssue Monitored: ngarcia
2016-07-01 14:57aferrazResolution time1467928800 => 1469138400
2016-07-01 14:59aferrazSeveritymajor => critical
2016-07-01 15:02aferrazAssigned ToTriage Finance => dmiguelez
2016-07-19 13:06egoitzIssue Monitored: egoitz
2016-07-20 11:25aferrazRelationship addedrelated to 0032504
2016-07-20 11:26aferrazRelationship addedrelated to 0031772
2016-07-20 11:31aferrazRelationship addedrelated to 0032023
2016-07-20 11:32aferrazRelationship addedrelated to 0032190
2016-07-20 11:36aferrazRelationship addedrelated to 0032012
2016-07-20 11:37aferrazRelationship deletedrelated to 0032012
2016-07-22 13:31VictorVillarResolution time1469138400 => 1471816800
2016-09-14 18:27aferrazStatusnew => scheduled
2016-09-16 13:34aferrazRelationship addedrelated to 0033968
2016-09-16 13:38aferrazRelationship addedrelated to 0033391
2016-09-16 13:40aferrazRelationship addedrelated to 0032012
2016-09-16 13:40aferrazRelationship deletedrelated to 0033391
2016-09-16 13:41aferrazRelationship deletedrelated to 0032012
2016-09-16 13:42aferrazRelationship addedrelated to 0032458
2016-10-11 12:51aferrazTarget Version => 3.0PR16Q4
2016-10-11 18:17aferrazTarget Version3.0PR16Q4 => 3.0PR17Q1
2016-10-11 18:24aferrazStatusscheduled => acknowledged
2016-10-11 18:24aferrazStatusacknowledged => scheduled
2016-11-03 21:03hgbotCheckin
2016-11-03 21:03hgbotNote Added: 0091135
2016-11-03 21:03hgbotStatusscheduled => resolved
2016-11-03 21:03hgbotResolutionopen => fixed
2016-11-03 21:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/37c5b07cf5e723aa6f758f284e5ac2d98b6137fc [^]
2016-11-03 21:03hgbotCheckin
2016-11-03 21:03hgbotNote Added: 0091136
2016-11-03 21:03hgbotCheckin
2016-11-03 21:03hgbotNote Added: 0091137
2016-11-03 21:03hgbotCheckin
2016-11-03 21:03hgbotNote Added: 0091138
2016-11-03 21:03hgbotCheckin
2016-11-03 21:03hgbotNote Added: 0091139
2016-11-03 21:03hgbotCheckin
2016-11-03 21:03hgbotNote Added: 0091140
2016-11-03 21:10aferrazReview Assigned To => aferraz
2016-11-03 21:10aferrazNote Added: 0091155
2016-11-03 21:10aferrazStatusresolved => closed
2016-11-03 21:10aferrazFixed in Version => 3.0PR17Q1
2016-11-04 13:23aferrazStatusclosed => new
2016-11-04 13:23aferrazResolutionfixed => open
2016-11-04 13:23aferrazFixed in Version3.0PR17Q1 =>
2016-11-04 13:23aferrazStatusnew => scheduled
2016-11-04 13:23aferrazStatusscheduled => resolved
2016-11-04 13:23aferrazFixed in Version => 3.0PR17Q1
2016-11-04 13:23aferrazResolutionopen => fixed
2016-11-04 15:06hgbotCheckin
2016-11-04 15:06hgbotNote Added: 0091174
2016-11-04 15:07aferrazNote Deleted: 0091155
2016-11-04 15:07aferrazNote Added: 0091177
2016-11-04 15:07aferrazStatusresolved => closed
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092586
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092587
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092588
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092589
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092590
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092591
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092597

Notes
(0091135)
hgbot   
2016-11-03 21:03   
Repository: erp/devel/pi
Changeset: 37c5b07cf5e723aa6f758f284e5ac2d98b6137fc
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Sep 26 19:57:27 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/37c5b07cf5e723aa6f758f284e5ac2d98b6137fc [^]

Fixes issue 33411: Bad performance in Costing Background with all adjustments

- Add M_TRANSACTION_TRXPROCDATE index same as M_TRANSACTION_MOVEMENTDATE
- Modify M_TRANSACTION_CALCULATED index, by adding movementdate column in order to improve CostingUtils.getMaxTransactionDate query.
- Add new M_LASTTRX table to store last transaction movementdate and improve CostAdjustmentUtils.isNeededBackdatedCostAdjustment query.

---
M src-db/database/model/tables/M_TRANSACTION.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_TABLE.xml
M src/org/openbravo/costing/CostAdjustmentUtils.java
M src/org/openbravo/costing/CostingServer.java
A src-db/database/model/tables/M_LASTTRX.xml
---
(0091136)
hgbot   
2016-11-03 21:03   
Repository: erp/devel/pi
Changeset: b818f7ffec53398f15bf879c547b3e15dbe9d23b
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Sep 27 12:38:06 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b818f7ffec53398f15bf879c547b3e15dbe9d23b [^]

Related to issue 33411: Code review improvements

- Remove unnecessary M_LASTTRX_PRODUCT_IDX and M_LASTTRX_WAREHOUSE_IDX indexes and create M_LASTTRX_PRODUCT_ORG_WH index with m_product_id, ad_org_id and m_warehouse_id columns.
- Remove unnecessary M_TRX_CALCULATED_MOVEMENTDATE and M_TRX_CALCULATED_PRODUCT_DATES indexes.
- Remove unneeded parameters in CostingServer.updateLastTransaction method, and make it private and non static.
- Remove unnecessary flush() after calling to updateLastTransaction, as flush() is already done in finally statement.
- Move getLastTransaction method from CostingServer to CostAdjustmentUtils class.
- Remove unneeded startingDate parameter in CostAdjustmentUtils.getLastTransaction method.
- Merge isBeforeLastTransaction and isAfterLastTransaction methods into CostAdjustmentUtils.compareToLastTransaction new method.

---
M src-db/database/model/tables/M_LASTTRX.xml
M src-db/database/model/tables/M_TRANSACTION.xml
M src/org/openbravo/costing/CostAdjustmentUtils.java
M src/org/openbravo/costing/CostingServer.java
---
(0091137)
hgbot   
2016-11-03 21:03   
Repository: erp/devel/pi
Changeset: 98b01a2f62a84a97bbf365a821c50d6c05ccbeb4
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Sep 27 19:29:56 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/98b01a2f62a84a97bbf365a821c50d6c05ccbeb4 [^]

Related to issue 33411: Rename table from M_LASTTRX to M_TRANSACTION_LAST

Rename table from M_LASTTRX to M_TRANSACTION_LAST and remove unneeded movementdate, trxprocessdate, movementtype and qty columns.

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_TABLE.xml
M src/org/openbravo/costing/CostAdjustmentUtils.java
M src/org/openbravo/costing/CostingServer.java
A src-db/database/model/tables/M_TRANSACTION_LAST.xml
R src-db/database/model/tables/M_LASTTRX.xml
---
(0091138)
hgbot   
2016-11-03 21:03   
Repository: erp/devel/pi
Changeset: e6b0b8ee69c8daba41933e00e01556bf27983a27
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Oct 11 18:50:35 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e6b0b8ee69c8daba41933e00e01556bf27983a27 [^]

Related to issue 33411: Run Synchronize Terminology

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src/org/openbravo/costing/CostAdjustmentUtils.java
M src/org/openbravo/costing/CostingServer.java
---
(0091139)
hgbot   
2016-11-03 21:03   
Repository: erp/devel/pi
Changeset: 201031bd9a93762689c7a18b68a41ae4c9a9669e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Sep 27 19:34:57 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/201031bd9a93762689c7a18b68a41ae4c9a9669e [^]

Related to issue 33411: Delete TransactionLast when validating new Costing Rule

Delete M_Transaction_Last when validating a new Costing Rule and exists a previous rule.

---
M src/org/openbravo/costing/CostingRuleProcess.java
---
(0091140)
hgbot   
2016-11-03 21:03   
Repository: erp/devel/pi
Changeset: 4d8e7bd1a1c149492500e43315a66d645ac7e23a
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Nov 03 13:57:43 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4d8e7bd1a1c149492500e43315a66d645ac7e23a [^]

Related to issue 33411: Initialize TransactionLast table

In case TransactionLast has not been initialized yet, it will be done by CostAdjustmentUtils.insertLastTransaction method when calling CostAdjustmentUtils.isNeededBackdatedCostAdjustment.

---
M src/org/openbravo/costing/CostAdjustmentUtils.java
---
(0091174)
hgbot   
2016-11-04 15:06   
Repository: erp/devel/pi
Changeset: 19f91532310ec185304e996111d85fc826a46247
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Nov 04 14:33:35 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/19f91532310ec185304e996111d85fc826a46247 [^]

Related to issue 33411: Update last transaction before check cost adjustments

---
M src/org/openbravo/costing/CostingServer.java
---
(0091177)
aferraz   
2016-11-04 15:07   
Code review + Testing OK
(0092586)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092587)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092588)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092589)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092590)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092591)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092597)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test