Tuesday, January 8, 2013

DB2 Access path Enhancements availabe with DB2 V10

1. New option, APCOMPARE, on the BIND and REBIND PACKAGE commands


With APCOMPARE, DB2 compares the incoming access paths with the ones that existed prior to the BIND/REBIND. Aggregated package-level statistics are reported via DSNT285I messages issued by the command. In addition, if the EXPLAIN (YES/ONLY) option is used, any differences are reported in the PLAN_TABLE.REMARKS column. Legal values of APCOMPARE are (NO) or (NONE), (WARN) and (ERROR).

-With (ERROR), if DB2 detects a difference between the incoming and old access paths, the package is not bound/rebound.

-With (WARN), package processing continues even if a difference in access paths is seen.

-With (NO) or (NONE), APCOMPARE is not performed. This is the default.

2. New option, APREUSE, on the BIND and REBIND PACKAGE commands

With APREUSE, DB2 attempts to keep the same access paths that existed prior to the BIND/REBIND. So, while the package structures are created afresh, if the reuse is successful, the new and old access paths are structurally identical in terms of the EXPLAIN information exposed in PLAN_TABLE. Aggregated package-level statistics are reported via DSNT286I messages issued by the command. In addition, if the EXPLAIN(YES/ONLY)option is used, details on the reuse successes/failures are reported via PLAN_TABLE.HINT_USED and PLAN_TABLE.REMARKS columns.

Please note that access path reuse is NOT guaranteed in all cases, and there may be statements whose access paths cannot be reused. Some common reasons for reuse failures include changes in schema (e.g. missing indexes), certain incompatibilities across versions (e.g., reusing DB2 9 access paths on DB2 10 may not work in all cases), insufficient information in the old packages for DB2 to reuse the access paths, etc.

Legal values of APREUSE are (NO) or (NONE), and (ERROR).

-With (ERROR), if DB2 is unable to reuse an old access path, the package is not bound/rebound.

-With (NO) or (NONE), APREUSE is not performed.

APREUSE(WARN) is not supported at this time.

3. New option, EXPLAIN(ONLY), on the REBIND PACKAGE command with EXPLAIN(ONLY), DB2 simulates the REBIND PACKAGE command such that only EXPLAIN tables (PLAN_TABLE, etc.) are populated, but the actual REBIND is not performed. For such rebinds, PLAN_TABLE.BIND_EXPLAIN_ONLY is set to 'Y'.

For additional details, refer to DB2 product documentation.

No comments:

Post a Comment