Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / April 2007

Tip: Looking for answers? Try searching our database.

FOR READ ONLY clause

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Veeru71 - 24 Apr 2007 12:04 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
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.