Description
The FREEZE PLANS command freezes query plans. To unfreeze frozen query plans use the UNFREEZE PLANS command.
FREEZE PLANS can freeze query plans with the Plan State Unfrozen. It cannot freeze query plans with the Plan State Unfrozen/Parallel.
FREEZE PLANS provides four syntax forms for freezing query plans:
-
A specified query plan: FREEZE PLANS BY ID statement-hash. The statement-hash value must be delimited by double quotation marks.
-
All query plans for a table: FREEZE PLANS BY TABLE table-name. You can specify a table name or a view name. If a query plan references multiple tables and/or views, specifying any of these tables or views freezes the query plan.
-
All query plans for all tables in a schema: FREEZE PLANS BY SCHEMA schema-name.
-
All query plans for all tables in the current namespace: FREEZE PLANS.
This command issues SQLCODE 0 if one or more query plans are frozen; it issues SQLCODE 100 if no query plans are frozen. The Rows Affected (%ROWCOUNT) indicates the number of query plans frozen.