Le jeu 06/11/2003 � 08:57, Charles Anthony a �crit : > Hi > > > 1) Using getStartAtIndex() and getEndAtIndex(): this sounds like an > > efficient way but if I look into the DB log there's no LIMIT option in > > the SQL query! This is really surprising isn't it? > > Currently, OJB does not attempt to use the LIMIT option. This is not > particularly surprising, since the "LIMIT" option is not available on all > databases, and, moreover, the syntax is wildly different between different > database. 20 minutes research comes up with the following for different > flavours of database. > > DB2 "SELECT ..... FETCH FIRST n ROWS ONLY" > MS-SQL "SELECT TOP n ... " > Oracle "SELECT ... WHERE rownum > n and rownum < m" > MySql "SELECT ... LIMIT m,n" > PostGress "SELECT ... LIMIT n OFFSET m" > HSQL "SELECT m,n ..." >
Wow, thanks to the SQL standard! > You'll note that they are very different. (I suspect that some of my syntax > above maybe wrong - I just sat down with google and searched for a bit). > > You'll also note that I am not saying that OJB *shouldn't* support the > ability to use the above syntaxes, just that it's not surprising that it > doesn't. Yes IMHO I think OJB should really support these specific syntaxes. Without being a DB guru I can say that very big SELECT queries with LIMIT options could avoid serious overload, so I hope that one these days a courageous OJB hacker will try to implement it.. Vincent --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
