If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Bind or not?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-18-04, 17:17
ad60 ad60 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
Bind or not?

We have runstats performed every night on DB2 V8.1 (AIX). I was running some snapshots earlier and I noticed that there were 32,000 dynamic sql statements executed and 53,000 static sql run. The way I understand it is that the dynamic sql always gets the most recent runstat data, but the static sql will only get the most recent data if a bind is performed after the runstats. Do we need to add a step of doing a bind after the runstats to improve the run time of the 53,000 static sql statements? If so, how much will this help?

Thanks
Anthony
Reply With Quote
  #2 (permalink)  
Old 08-18-04, 17:34
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If your stats don't significantly change or you are satisfied with the access path of the packages, then don't rebind.

Dynamic plans may not make use of the new stats if they are still in package cache. Reuse of packages in cache depends on several factors.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 08-19-04, 02:05
hurmavi hurmavi is offline
Registered User
 
Join Date: Jan 2004
Location: Europe, Finland, Helsinki
Posts: 60
Yep!

Marcus has it right!

In our shop we have noticed, when talking about a new application, that during first 1/2 year runstats and rebind shoud run quite often. After that once in a year is about right. Exept when a significant changes in data material will happen (big inserts, deletes or updates).

Cheers, Bill
Reply With Quote
  #4 (permalink)  
Old 08-19-04, 10:04
ad60 ad60 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
Marcus wrote:
Dynamic plans may not make use of the new stats if they are still in package cache.

Is there anything you can do to flush the package out of the cache so the dynamic plans pick up the new stats? Re-bind won't do this?

Thanks
Anthony
Reply With Quote
  #5 (permalink)  
Old 08-19-04, 10:38
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
FLUSH PACKAGE CACHE DYNAMIC. See the SQL Reference for details.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 08-19-04, 14:48
ad60 ad60 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
Wouldn't the package cache get flushed at instance stop/start time? We stop and start our instance before our tests. If it does get flushed, we wouldn't need to do the "flush package cache dynamic", or am I wrong?
Reply With Quote
  #7 (permalink)  
Old 08-23-04, 14:37
ad60 ad60 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
Thanks Marcus. The FLUSH PACKAGE CACHE DYNAMIC really made a positive difference with our testing!

Anthony
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On