Discussion:
QUERY OPTIMIZATION
(too old to reply)
sree
2007-10-26 10:46:13 UTC
Permalink
Hi

Is it a good practice to use the statement
"SET CURRENT QUERY OPTIMIZATION = 9"
within a stored procedure?

Does it improve the performance of the Stored procedure?
What is the default value , if we are not specifying a value for this?

Thanks
Sree
Blair Kenneth Adamache
2007-10-26 14:13:33 UTC
Permalink
The default value is 5. I would avoid altering this unless there are
specific queries that you can prove run better with a different
optimization level. 9 means perform more optimization, which means more
time is spent in the DB2 optimizer trying to find a better plan. The
time spent in the optimizer can sometimes be greater than executing a
simple plan (optimization=0) for a small table.

See:

http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0001007.htm
Post by sree
Hi
Is it a good practice to use the statement
"SET CURRENT QUERY OPTIMIZATION = 9"
within a stored procedure?
Does it improve the performance of the Stored procedure?
What is the default value , if we are not specifying a value for this?
Thanks
Sree
Loading...