Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036473Openbravo ERPY. DBSourceManagerpublic2017-07-12 12:012017-07-19 14:09
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
Production - QA Approved
2017-02-16
3.0PR17Q2
https://code.openbravo.com/erp/devel/dbsm-main/rev/09172053fd892f54d5b2180b7a751df353041b9e [^]
No
0036473: unnecessary recreation of PL code in update.database
In PostgreSQL update.database unnecessarily regenerates all PL code (triggers + functions) whenever it is executed.
In an instance without any XML modification since last build execute:

$ ant update.database
...
     [java] 14083 INFO - Updating database model...
     [java] 88717 INFO - Executed 2110 SQL command(s) successfully
...
BUILD SUCCESSFUL
Total time: 1 minute 50 seconds


  -> Check 2110 commands were executed taking ~70s to complete
Fix for issue 0035284 incorrectly assumed PL standardization was not required in update database. This is not true because PL code in DB is compared with XML model to decide whether it should or not be re-applied.

PL standardization is done in JVM and can be parallelized which is in general much faster than actual SQL execution to drop and recreate the code. So changeset for 0035284 is going to be reverted.
Performance
caused by defect 0035284 closed alostale update.database unnecessarily standardizes DB PL code 
Issue History
2017-07-12 12:01alostaleNew Issue
2017-07-12 12:01alostaleAssigned To => platform
2017-07-12 12:01alostaleModules => Core
2017-07-12 12:01alostaleTriggers an Emergency Pack => No
2017-07-12 12:01alostaleAssigned Toplatform => alostale
2017-07-12 12:03alostaleRegression date => 2017-02-16
2017-07-12 12:03alostaleRegression introduced in release => 3.0PR17Q2
2017-07-12 12:03alostaleRegression introduced by commit => https://code.openbravo.com/erp/devel/dbsm-main/rev/09172053fd892f54d5b2180b7a751df353041b9e [^]
2017-07-12 12:03alostaleRelationship addedcaused by 0035284
2017-07-12 12:14alostaleNote Added: 0098044
2017-07-12 12:14alostaleReview Assigned To => caristu
2017-07-12 12:14alostaleTag Attached: Performance
2017-07-12 12:29hgbotCheckin
2017-07-12 12:29hgbotNote Added: 0098045
2017-07-12 12:29hgbotCheckin
2017-07-12 12:29hgbotNote Added: 0098046
2017-07-12 12:29hgbotStatusnew => resolved
2017-07-12 12:29hgbotResolutionopen => fixed
2017-07-12 12:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/86b1e1826763666021207068179e6871f5e38f5f [^]
2017-07-12 12:29hgbotCheckin
2017-07-12 12:29hgbotNote Added: 0098048
2017-07-12 12:29hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/86b1e1826763666021207068179e6871f5e38f5f [^] => http://code.openbravo.com/erp/devel/pi/rev/e109968e82aa10126efa6bf53b1a401f5d72d159 [^]
2017-07-12 12:44alostaleRegression level => Production - QA Approved
2017-07-19 14:09caristuNote Added: 0098136
2017-07-19 14:09caristuStatusresolved => closed
2017-07-19 14:09caristuFixed in Version => 3.0PR17Q4

Notes
(0098044)
alostale   
2017-07-12 12:14   
After fix applied time is reduced from 1 minute 50 seconds to 41 seconds
(0098045)
hgbot   
2017-07-12 12:29   
Repository: erp/devel/dbsm-main
Changeset: b5b1a85431b1932bec7f357abd6ba351c7d5973c
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 12 12:05:37 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/b5b1a85431b1932bec7f357abd6ba351c7d5973c [^]

related to issue 36473: log query times

---
M src/org/apache/ddlutils/platform/StandardBatchEvaluator.java
---
(0098046)
hgbot   
2017-07-12 12:29   
Repository: erp/devel/dbsm-main
Changeset: 86b1e1826763666021207068179e6871f5e38f5f
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 12 12:17:15 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/86b1e1826763666021207068179e6871f5e38f5f [^]

fixed bug 36473: unnecessary recreation of PL code in update.database

  Standardize PL code in update.database so it does not require to rebuild it if
  it didn't change.

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
A src-test/src/org/openbravo/dbsm/test/model/recreation/PLCode.java
---
(0098048)
hgbot   
2017-07-12 12:29   
Repository: erp/devel/pi
Changeset: e109968e82aa10126efa6bf53b1a401f5d72d159
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 12 12:28:55 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e109968e82aa10126efa6bf53b1a401f5d72d159 [^]

fixed 36473, fixed 36475

  new jar including patches for both issues

---
M src-db/database/lib/dbsourcemanager.jar
---
(0098136)
caristu   
2017-07-19 14:09   
Code reviewed + tested OK.