Difference between Plan & Package
Both contain optimized code for SQL statements - a package for a single program, module or subroutine contained in the data base request module (DBRM) library. A plan may contain multiple packages and pointers to packages.
A plan is an executable module containing the access path logic produced by the DB2 optimizer. It can be composed of one or more DBRMs and packages. Before a DB2 for Z\OS program(with static SQL) can be run, it must have a plan associated with it.
Plans are created by the BIND command. The plan is stored in the DB2 directory and accessed when its program is run. Information about the plan is stored in the DB2 catalog.
A package is a single, bound DBRM with optimized access paths. By using packages, the table access logic is "packed" at a lower level of granularity than a plan--at the package(or program) level.
To execute a package, you first must include it in the package list of a plan. Packages are not directly executed, they are only indirectly executed when the plan in which they are contained executes--as discussed previously, UDFs and triggers are execeptions to this rule. A plan can consist of one or more DBRMs, one or more packages or, a combination of packages and DBRMs.
Both contain optimized code for SQL statements - a package for a single program, module or subroutine contained in the data base request module (DBRM) library. A plan may contain multiple packages and pointers to packages.
A plan is an executable module containing the access path logic produced by the DB2 optimizer. It can be composed of one or more DBRMs and packages. Before a DB2 for Z\OS program(with static SQL) can be run, it must have a plan associated with it.
Plans are created by the BIND command. The plan is stored in the DB2 directory and accessed when its program is run. Information about the plan is stored in the DB2 catalog.
A package is a single, bound DBRM with optimized access paths. By using packages, the table access logic is "packed" at a lower level of granularity than a plan--at the package(or program) level.
To execute a package, you first must include it in the package list of a plan. Packages are not directly executed, they are only indirectly executed when the plan in which they are contained executes--as discussed previously, UDFs and triggers are execeptions to this rule. A plan can consist of one or more DBRMs, one or more packages or, a combination of packages and DBRMs.
No comments:
Post a Comment