Plan table considerations

Whenever an SQL statement is explained, the result is written as an entry into a plan table.

When the Explain function performs a dynamic Explain, the result is written to the PLAN_TABLE of the current SQLID. The current SQLID is either the same ID as the one used for your Online Monitor session or the ID that you specify in the Explain Menu. You can then examine the explained SQL statement residing in the plan table by using the Db2® Explain Output panel and its associated windows.

If you request a dynamic Explain of an SQL statement, and if you do not have an up-to-date plan table, one of these windows is displayed:
  • If a plan table currently does not exist, the Create Plan Table window prompts you to create a plan table.
  • If a plan table exists, but does not match your current version of Db2, the Upgrade Plan Table windowprompts you to upgrade the plan table.

Create Plan Table window

If a plan table does not exist when a dynamic Explain is required, the Create Plan Table window is displayed.

Use the Create Plan Table window to specify the database name (optional), and table space name of the table to be created (optional). If neither are entered, a plan table is created in the default database DSNDB04. If this database does not exist or you do not have sufficient authority, an error message is displayed.
Figure 1. Create Plan Table window

DGOMYWQC                Create Plan Table

You do not have a plan table. Update the database name and table
space name as required, then press Enter to create the plan table.

Database name  . . . . . . . . DSNDB04
Table space name . . . . . . .

 F1=Help    F2=Split   F9=Swap   F12=Cancel

Upgrade Plan Table window

If a plan table exists but does not match your current version of Db2, the Upgrade Plan Table window is displayed. Use this window to confirm that the table definition be upgraded to match your current version of Db2.
Figure 2. Upgrade Plan Table window

DGOMYWQU                Upgrade Plan Table

Your plan table definition does not include all the columns
required by DB2PM.

To upgrade the plan table, press Enter.

 F1=Help    F2=Split   F9=Swap   F12=Cancel