Quote:
|
Originally Posted by Kota
Actually I did do extensive benchmarking. Since its a java code, we tried setting optimization levels using JDBC obviously. The query time came down from 5s to 200ms for that query. We were only concerned about any negative impact that it might have.
Also want to confirm about a registry variable named
DB2_EXTENDED_OPTIMIZATION. This registry variable specifies whether or not the query optimizer will use optimization extensions to improve query performance. I haven't found much documentation about how its going to affect the other applications or this particular query with data changes ....
Appreciate your help.
|
I'm not familiar with DB2_EXTENDED_OPTIMIZATION, maybe someone else could comment on that.
Typically the only penalty of higher optimization is the longer prep time. You are allowing the optimizer to consider more access plans before chosing which one it thinks is optimal. This does not guarantee a faster access plan, but that's why they tell you to benchmark.

It will give you a plan with a lower or equal "timeron" estimate, whether it is actually faster depends on how closely the real work matches what you've told the optimizer (ie. statistics, CPUSPEED, etc.)
And sometimes the optimizer coughs up a hairball... but that can happen at any optimization level...
Just my thoughts/experience. If it's faster, I'd stick with it.