BIND or REBIND ? I am confused

I always had this question when I came across performance tuning, version upgrades, -805's etc on a program module ( DB2 package ).


When do you perform BIND's ?


I have an application program which has embedded SQL's in them. All that EXEC : END-EXEC thingy. Hey, I just figured out that SQL # 123 can be modified to improve performance or to achieve the same results in a more quick and efficient manner. What do I do ? Well, I go and perform the percompile, link-edit & BIND - Job well done !


So you got your answer - If you have a SQL code-change, code-modification or code removal which involves editing your source library using ISPF 3.4 and applying the change - you BIND !


When do you perform REBIND's ?


I have an application program that is eating up all my resources due to a bad query. I figured out that by creating an INDEX I can bring it back on track and save DB2 CPU time. Well, I created the index - what next ? - REBIND the program for the query to access the new INDEX - Job well done !


Now you know - REBIND's are performed when there are no code-changes in your program. You perform REBIND's to update the access path or to synchronize your program(s) with the objects that were created/altered in them.


Any Similarities ?


Both the operation tend to change/modify the access path if not analyzed prior to performing them.


Any Differences ?


Watch out - There is no concept of LIBRARY in the REBIND control card as opposed to the BIND control card. This is why - REBIND's can never cause/fix -805's


Oh GOD ! I performed a BIND instead of REBIND, what will happen ?


Taking into account there was no change in the DBRM library and there were no changes in any of the parameters such as OWNER, MEMBER, QUALIFIER etc while performing the BIND - You will always remain SAFE if you perform a BIND instead of a REBIND! why ? - You didn't change the CONTOKEN while performing this action, that's why !




No comments:

Post a Comment