Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035296
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagerminorhave not tried2017-02-17 12:072017-03-15 20:19
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revision490d93599594
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035296: pl functions with out and defaults params can be slow to standardize

DescriptionIf there are PL functions with many parameters (>25) some of having default values and some other begin output parameters and there is another PL function that invokes it not passing all of the parameters to make use of the defaults, export.database take ages to complete.

The problem is caused because dbsm translates function Oracle function invocation for functions with out params in "select * into outp from function(inp)", this transformation is done with regexps, with many parameters applying the regexp in case it does not match is really slow.

See examples: https://gist.github.com/alostale/ddfd1ca890e3dbae3c3558fc2fa1bfc6 [^]
Steps To Reproduce1. patch pi (rev aff21cc5e768) with attached diff
2. update.database
3. export.database -> it can take hours to complete function standardization part
Proposed SolutionBecause the cases where it is slow is actually the ones that will not match, it is possible to know in advance these case by just counting the number of parameters the lines has, so in these cases the expression does not require to be applied.
TagsPerformance
Attached Filesdiff file icon m_get_stock_param1.diff [^] (977 bytes) 2017-02-17 12:08 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0035284 closedalostale update.database unnecessarily standardizes DB PL code 
blocks defect 0035297 closedalostale PL functions with optional constant params are not correctly standardized 

-  Notes
(0094469)
hgbot (developer)
2017-02-20 14:49

Repository: erp/devel/dbsm-main
Changeset: dcd0a1c5dc184fb1d43658f0dd1acdbb4fb26773
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Feb 17 12:23:04 2017 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/dcd0a1c5dc184fb1d43658f0dd1acdbb4fb26773 [^]

related to issue 35296: added missing license and reformat

---
M src/org/apache/ddlutils/platform/postgresql/PostgrePLSQLStandarization.java
---
(0094470)
hgbot (developer)
2017-02-20 14:49

Repository: erp/devel/dbsm-main
Changeset: 05dcb0005fc0934fc4bfaefedf914bf8a960fb33
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Feb 17 12:26:20 2017 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/05dcb0005fc0934fc4bfaefedf914bf8a960fb33 [^]

fixed bug 35296: pl with out and defaults params is slow to standardize

  Applying the regexp to do these transformations is very slow in case of many
  paramters and non matching pattern.

  Fixed by preventing it to be applied in case the number of parameters in the
  evaluated string doesn't match with the number defined in the pattern.

---
M src/org/apache/ddlutils/platform/postgresql/PostgrePLSQLStandarization.java
A src/org/apache/ddlutils/translation/ReplaceOutFunctionParams.java
---
(0094473)
hgbot (developer)
2017-02-20 14:49

Repository: erp/devel/pi
Changeset: 490d93599594dac190b9711b1a43054ad51cf025
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Feb 17 12:34:43 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/490d93599594dac190b9711b1a43054ad51cf025 [^]

fixed bug 35284, fixed bug 35297, fixed bug 35296

  dbsourcemanager.jar including fixes for these 3 issues.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0094654)
caristu (developer)
2017-02-28 09:28

Code review + tested in pi@1e7495658970
(0095197)
hudsonbot (developer)
2017-03-15 20:19

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/54e102bef53e [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-02-17 12:07 alostale New Issue
2017-02-17 12:07 alostale Assigned To => platform
2017-02-17 12:07 alostale Modules => Core
2017-02-17 12:07 alostale Triggers an Emergency Pack => No
2017-02-17 12:08 alostale File Added: m_get_stock_param1.diff
2017-02-17 12:08 alostale Assigned To platform => alostale
2017-02-17 12:08 alostale Status new => acknowledged
2017-02-17 12:09 alostale Relationship added related to 0035284
2017-02-17 12:09 alostale Tag Attached: Performance
2017-02-17 12:14 alostale Relationship added blocks 0035297
2017-02-20 14:49 hgbot Checkin
2017-02-20 14:49 hgbot Note Added: 0094469
2017-02-20 14:49 hgbot Checkin
2017-02-20 14:49 hgbot Note Added: 0094470
2017-02-20 14:49 hgbot Status acknowledged => resolved
2017-02-20 14:49 hgbot Resolution open => fixed
2017-02-20 14:49 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/05dcb0005fc0934fc4bfaefedf914bf8a960fb33 [^]
2017-02-20 14:49 hgbot Checkin
2017-02-20 14:49 hgbot Note Added: 0094473
2017-02-20 14:49 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/05dcb0005fc0934fc4bfaefedf914bf8a960fb33 [^] => http://code.openbravo.com/erp/devel/pi/rev/490d93599594dac190b9711b1a43054ad51cf025 [^]
2017-02-20 14:50 alostale Review Assigned To => caristu
2017-02-28 09:28 caristu Note Added: 0094654
2017-02-28 09:28 caristu Status resolved => closed
2017-02-28 09:28 caristu Fixed in Version => 3.0PR17Q2
2017-03-15 20:19 hudsonbot Checkin
2017-03-15 20:19 hudsonbot Note Added: 0095197


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker