Posted: Thu Sep 09, 2004 3:55 am Post subject: plan_table
Hi all,
question about plan_table:
everytime i use the option Explain(yes) at the bind moment it populates the plan_table. If i perform again the explain (yes), it updates the rows already contains in plan_table, or it adds new rows.
If a perfom the explain option hundred of times for the same program, i'm updating rows in plan_table or everytime i add there several rows.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Sep 09, 2004 5:37 am Post subject:
Monaco,
It is good idea to add rows to the plan_table rather than updating the existing rows in the plan_table if it had any. Sometimes DB2 uses the QUERYNO, APPLNAME, PROGNAME, VERSION, COLLID, and OPTHINT columns of the PLAN_TABLE to determine the rows to use for a hint. For a PLAN_TABLE row, the QUERYNO, APPLNAME, PROGNAME, VERSION, and COLLID values must match the corresponding values for an SQL statement before the SQL statement can use that row. In addition, the OPTHINT value for that row must match the value in the CURRENT OPTIMIZATION HINT special register if the SQL statement is executed dynamically. If the SQL statement is executed statically, the OPTHINT value for the row must match the value of bind option OPTHINT for the package or plan that contains the SQL
statement. If no PLAN_TABLE rows meet these conditions, DB2 determines the access path for the SQL statement without using hints.
Also it helps to compare the access paths from the previous bind to the new bind.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum