View previous topic :: View next topic
|
Author |
Message |
chinnielr
New User
Joined: 11 Jul 2005 Posts: 87
|
|
|
|
Hi,
One of my job uses a REXX utility step which executes a DB2 query. It was running for more than 5 hours and we cancelled the job.
When we ran the same query again after sometime it ran within 1 hour.
We did a EXPLAIN and we did not see any hot spots.
Our DBA tells us that
Quote: |
"It looks like the BD2 access path took a turn for the worse which can happen from time to time with dynamic sql". |
But the query by itself is not dynamic only the plan get created dynamically. Can we still say it is dynamic query?
Code: |
My question is will access path gets changed dynamically? if so can we force Db2 to select the optimal access path? |
Can some please help me in understand the selection of access path.
PS: I think DB2 optimizer will select the best available optimal path?
Your help is really appreciated.
Regards,
Chinni |
|
Back to top |
|
|
sambit_mech
New User
Joined: 14 Jul 2010 Posts: 13 Location: India
|
|
|
|
I think your bind card contains VALIDATE(RUN) instead of VALIDATE(BIND). |
|
Back to top |
|
|
chinnielr
New User
Joined: 11 Jul 2005 Posts: 87
|
|
|
|
No there is no BIND card for this. This is just a query getting executed from a step.
Regards,
Chinni |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
afaik Rexx is always dynamic.
Access path should/can only change if some statistics have been run on the underlying tables |
|
Back to top |
|
|
chinnielr
New User
Joined: 11 Jul 2005 Posts: 87
|
|
|
|
Thanks for your quick responses. Can you please let me know whether we can force DB2 to select the opimal access path? Not sure if we can do so.
Regards,
Chinni. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
|