When I am running a SELECT statement form command line processor, is
there any performance benefit in including "for read only" cluase on
the SELECT statement ? I am not talking about any cursors though.
- Thanks
Serge Rielau - 24 Apr 2007 15:19 GMT
> When I am running a SELECT statement form command line processor, is
> there any performance benefit in including "for read only" cluase on
> the SELECT statement ? I am not talking about any cursors though.
Implicitly CLP will turn your SELECT into a cursor.
A cursor which is explicitly defined as READ ONLY will use "blocking".
That is the server will send several rows at once to the client.
Without READ ONLY DB2 will only do this for cursors that are on
principle non updatable (such as joins).
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
jefftyzzer - 24 Apr 2007 17:23 GMT
> When I am running a SELECT statement form command line processor, is
> there any performance benefit in including "for read only" cluase on
> the SELECT statement ? I am not talking about any cursors though.
> - Thanks
There may be a perceived performance benefit in terms of aggregate
throughput, as you will be taking share locks and thus allowing others
to do the same. Your SELECT won't execute any faster, but more people
will be able to read and thus be productive.
--Jeff