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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0022559
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] A. Platformminorhave not tried2012-12-13 11:072016-07-05 17:28
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q3
StatusclosedFix in branchFixed in SCM revision21698df6e4fe
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0022559: SqlC does execute all queries at compile time, which is not required.

DescriptionSqlC does execute all select queries at compile time when it is processing xsql files.
Technically that is needed to get the number, names & data-types of the columns in the result as that info is used to generate the fields and data-reading code in the to be generated java file.

However the jdbc spec does have a optional method to get that same information for a query without executing it.

Postgresql does implement that optional method.
Oracle jdbc driver does implement that method only starting with Oracle 11R2
Quoting: https://docs.oracle.com/cd/E18283_01/java.112/e16548/whatsnew.htm#CJACGJHA [^]

""
Starting from Oracle Database 11g Release 2 (11.2), JDBC drivers support obtaining the metadata of a SELECT statement without executing the PreparedStatement. This feature works even with the earlier database releases. For more information, please refer to "Interface oracle.jdbc.OraclePreparedStatement".
""

So it should be fine to just have the updated jdbc driver even when the database behind is not yet 11R2 (Important as System Requirements only have 11 as min version, we do not require R2)


A prototype patch exist which does use this improvement transparently on postgresl and will remove all execution times for those queries on that db.

Steps To Reproduce-
Proposed SolutionReview & apply proposed patch to get this compile time improvement on the database where it is possible.
TagsPerformance
Attached Filesdiff file icon 0011-pending22559.diff [^] (894 bytes) 2016-06-05 16:11 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0022553 newAugustoMauch sqlc.queryExecutionStrategy=optimized not applied in modules 
depends on backport 00334343.0PR16Q2.1 closedshuehner SqlC does execute all queries at compile time, which is not required. 
has duplicate defect 0020173 closedgorka_gil Build in 64bit environment generates "Error occurred during initalizaiton of VM" and "Too small inital heap" at sqlc 

-  Notes
(0087004)
shuehner (administrator)
2016-06-05 16:21

Testing in bigger database:
a.) compile.complete.deploy now possible to run without needing to increase build.maxmemory -> before failed
a.) Compile.complete.deploy goes 1min faster by avoiding to run slow queries
(0087328)
hgbot (developer)
2016-06-16 10:04

Repository: erp/devel/pi
Changeset: 21698df6e4fe6e0272f997ba99be1c38bc966ee7
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Jun 16 10:04:13 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/21698df6e4fe6e0272f997ba99be1c38bc966ee7 [^]

fixed issue 22559: SqlC does execute all queries at compile time

  SqlC does execute all select queries at compile time when it is processing
  xsql files.

  Technically that is needed to get the number, names & data-types of the columns
  in the result as that info is used to generate the fields and data-reading code
  in the to be generated java file.

  However the jdbc spec does have a optional method to get that same information
  for a query without executing it.

  As this method is supported in current jdbc drivers for both Oracle and PostgreSQL,
  now it is used instead of executing the whole queries.

---
M src-core/src/org/openbravo/data/Sqlc.java
---
(0087332)
alostale (developer)
2016-06-16 10:30

code reviewd + tested both in Oracle and PG
(0087625)
hudsonbot (developer)
2016-06-17 19: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/0dc7be081b1c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2012-12-13 11:07 shuehner New Issue
2012-12-13 11:07 shuehner Assigned To => AugustoMauch
2012-12-13 11:07 shuehner Modules => Core
2012-12-13 11:07 shuehner Triggers an Emergency Pack => No
2012-12-13 11:07 shuehner Relationship added related to 0022553
2012-12-13 11:09 shuehner Relationship added related to 0020173
2016-06-05 16:07 shuehner Assigned To AugustoMauch => platform
2016-06-05 16:10 shuehner Summary SqlC does execute all queries at compile time, that can be avoid on pgsql (but not on oracle) => SqlC does execute all queries at compile time, which is not required.
2016-06-05 16:10 shuehner Description Updated View Revisions
2016-06-05 16:10 shuehner Tag Attached: Performance
2016-06-05 16:11 shuehner File Added: 0011-pending22559.diff
2016-06-05 16:21 shuehner Note Added: 0087004
2016-06-16 10:04 hgbot Checkin
2016-06-16 10:04 hgbot Note Added: 0087328
2016-06-16 10:04 hgbot Status new => resolved
2016-06-16 10:04 hgbot Resolution open => fixed
2016-06-16 10:04 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/21698df6e4fe6e0272f997ba99be1c38bc966ee7 [^]
2016-06-16 10:05 alostale Assigned To platform => shuehner
2016-06-16 10:30 alostale Review Assigned To => alostale
2016-06-16 10:30 alostale Note Added: 0087332
2016-06-16 10:30 alostale Status resolved => closed
2016-06-16 10:30 alostale Fixed in Version => 3.0PR16Q3
2016-06-17 19:38 hudsonbot Checkin
2016-06-17 19:38 hudsonbot Note Added: 0087625
2016-07-05 17:28 Orekaria Status closed => new
2016-07-05 17:28 Orekaria Resolution fixed => open
2016-07-05 17:28 Orekaria Fixed in Version 3.0PR16Q3 =>
2016-07-05 17:28 Orekaria Status new => scheduled
2016-07-05 17:28 Orekaria Status scheduled => resolved
2016-07-05 17:28 Orekaria Resolution open => fixed
2016-07-05 17:28 Orekaria Status resolved => closed
2016-07-05 17:28 Orekaria Fixed in Version => 3.0PR16Q3
2016-07-26 12:36 shuehner Relationship replaced has duplicate 0020173


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker