Freeing statement-level access paths
You can remove catalog table rows that are used to influence access path selection. Doing so enables Db2 to optimize the access path for the statements, and reclaims disk space that is used to store the catalog table rows.
Before you begin
- You have one of the following authorities:
- SQLADM
- SYSADM
- SYSCTRL
- SYSOPR
Important: Catalog table rows that enforce access
path reuse are also removed for specified statements. When the statements
are next prepared, Db2 generates
new access paths for any such statements.
Procedure
To free access paths:
Issue a FREE QUERY command, and specify one of the options
that are shown in the following table:

| Option | Description |
|---|---|
| To delete all existing rows | Specify the QUERYID(ALL) option. |
| To delete only rows for a particular query | Specify QUERYID(queryID), where queryID matches the value of the QUERYID column of the catalog tables. |
| To delete all rows for a group of related queries. | Specify FILTER(value), where value is the value of the FILTER column of the USERFILTER column in the SYSIBM.SYSQUERY catalog table. |