When would you go for REBIND? Can rebinding be done for plans as well as for packages?
There are two basic mindsets on when to REBIND your plans and packages. The first -- which I believe is the best approach -- is to REBIND regularly after running RUNSTATS. Using this approach you will ensure that your access paths have been formulated by the
optimizer using the most up-to-date information available on your data. Of course, the DB2 optimizer is not perfect so sometimes rebinding can cause the performance of certain
statements to degrade. You will have to be ready to handle these problems by using optimization hints (OPTHINT in the PLAN_TABLE) to go back to a satisfactory access path or by tweaking your SQL to achieve a better performing access path.
The second approach is the "if it ain't broke, don't fix it" approach. In this scenario, you will continue to run RUNSTATS regularly but you will not REBIND your plans and packages until performance degrades. This approach is embraced by shops that do not have the manpower or time to review all access paths after a mass REBIND. By not running REBIND the thought is that performance will continue along as is until data volumes change so significantly that end users start to complain. Only then will individual plans and packages be rebound following the next scheduled RUNSTATS or immediately if the problem is large enough.
Examine your shop's approach to the REBIND issue to see which approach is best for you. Although philosophically I agree with the first approach, I understand that the second approach can be preferable in practice. If you follow the second approach, be sure that you have pre-agreed
Service Level Agreements
(SLAs) for your DB2 applications. Then, you can reasonably argue that there is no reason to REBIND anything until, or unless you are no longer meeting the SLA.
Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our