A package is a single, bound DBRM with optimized access paths. By using packages, the table access logic is “packaged” at a lower level of granularity than a plan.
As we all know “Bind Package” is not executable. Exceptions: UDFs and Triggers.
32 Complex SQL Queries
Useful for interview and projects.
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.
So plan is higher in level than package.
A plan can consist of one or more DBRMs, one or more packages or, a combination of packages and DBRMs.