The DB2 platform/dialect is inefficient, out of date and inexact [message #1751306] |
Sat, 07 January 2017 13:04 |
Denis Forveille Messages: 10 Registered: July 2016 |
Junior Member |
|
|
The DB2 dialect implemented in class org.eclipse.persistence.platform.database.DB2Platform is inexact, inefficient and out of date, at least for "recent" versions of DB2 (ie less than 7 years..)
For example, in the case of the usage of method Query.setFirstResult(..) and/or Query.setMaxResult(..) , EclipseLInk generate a ugly SELECT statemenet with many levels of subselect based on ROWNUMBER() function where it could generate a very simple query by using DB2 "OFFSET x ROWS" and "FETCH FIRST x ROWS ONLY" syntax
The dialect also acces SYSIBM.* tables where it should access SYSCAT.* views instead
Some other query are very ineffiicient, for example to get the current timestamp:
"SELECT DISTINCT CURRENT TIMESTAMP FROM SYSIBM.SYSTABLES"
where it could be
"VALUES CURRENT TIMESTAMP"
Some DB2 limits are inexact. eg the max length of a unique key constraint is 128, not 18
Maybe it's time to provide a DB210 platform/dialect
[Updated on: Sat, 07 January 2017 13:06] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03798 seconds