Daniel John Debrunner wrote: > Derby supports limiting the number of rows returned by a query through > the standard JDBC java.sql.Statement.setMaxRows() method.
And does it affect the execution plan? Knowing the maximum number of records would be extremely useful for query optimizer, which could select a much faster plan using indexes which otherwise has higher "per record" cost over mass methods like full table scan... This was (is?) one of the major shortcomings in SapDB - it always realized query for first few records starting with specific value in an (existing) index order by full table scan and sort, thinking the index scan would cost much more. Jan
signature.asc
Description: OpenPGP digital signature
