Using many small plans

Using many small plans requires many transaction IDs, each of which has a corresponding plan. This technique reduces plan sizes and plan overlap.

You are recommended to use packages rather than using many small plans.

Using many small plans implies either that the program flow follows a narrow path with limited possibilities for branching out, or that plan switching takes place frequently.

In the example in Figure 1 , the switching could take place between program P0 and the programs at the next lower level, or between program PA and the programs at the next lower level.
  • PLAN1 for (TRX0) using the DBRMs from programs P0, P1, P2, and P3.
  • PLANA for (TRXA) using the DBRMs from programs PA, PB, PC, and PD.

However, program P3 can transfer control (using the XCTL command) to program PB. A plan switching technique must then be used.

A special variation of using small plans exists. In some applications, it can be convenient to have the terminal user specify the transaction ID for the next transaction. It is typically in read-only applications, where the user can choose between many different information panels by entering a systematically built 1- to 4-character transaction ID. The advantage for the user is the ability to jump from any panel to any other panel without passing a hierarchy of submenus.

If a DB2 plan is associated with each transaction ID, the application ends up with many small plans.