Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Praveen Devarao
RE: How to set the Query Optimization Level? [ reply ]  
2010-08-17 09:25
Hi Johannes,

Currently there is no option through which you can set the Query Optimization Level through the ibm_db gem.

However, you can set it through CLI (through which ibm_db gem accesses DB2) by issuing the following command.

db2 update cli cfg for section common using DB2OPTIMIZATION 5

#[or just edit your db2cli.ini file and add the below line under section common or as appropriate

DB2OPTIMIZATION=5
]

By issuing the above command, every time a successful connection is made (ibm_db.connect) the below query is issued implcitly

SET CURRENT QUERY OPTIMIZATION 5

Let me know if this helps.

Reference: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.apdv.cli.doc/doc/r0008785.html

Thanks

Praveen

By: Johannes Fahrenkrug
How to set the Query Optimization Level? [ reply ]  
2010-08-17 08:10
How can I set the query optimization level when I use the DB2 gem? Only by issuing a statement "by hand" or is there some option I can set?

Thanks!

- Johannes