
Signature
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Let us take as example:
select * from mytable order by primary_key fetch first 1000 rows only
optimize for 1 row
When will the access plan be choosen for this query?
Will it be at prepare time (taken the example of the CLI interface)
(one compilation/optimization step, being it SQLJ, JDBC, CLI, ...), or
at first fetch time, when all attributes associated with the cursor
(read-only or not, scroll or not, keyset or not) are known, wich could
influence the path decision and how the data will be materialized for
the application?
Bernard Dhooghe
Serge Rielau - 30 Aug 2005 03:07 GMT
> Let us take as example:
>
[quoted text clipped - 9 lines]
> influence the path decision and how the data will be materialized for
> the application?
The cursor is compiled at OPEN. Presumably all these attributes are set
by the time you do OPEN.
Cheers
Serge

Signature
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Bernard Dhooghe - 30 Aug 2005 08:33 GMT
Thank you Serge, clarifies difference between prep and access plan
build step (for dynamic programming interface).
Bernard Dhooghe