The CURRENT QUERY OPTIMIZATION special register specifies an INTEGER value that controls the class of query optimization performed by the database manager when binding dynamic SQL statements. The QUERYOPT bind option controls the class of query optimization for static SQL statements (see the Command Reference for additional information on the QUERYOPT bind option). The possible values range from 0 to 9. For example, if the query optimization class is set to the minimal class of optimization (0), then the value in the special register is 0. The default value is determined by the dft_queryopt database configuration parameter.
Its value can be changed by the SET CURRENT QUERY OPTIMIZATION statement (see SET CURRENT QUERY OPTIMIZATION).
Using the SYSCAT.PACKAGES catalog view, find all plans that were bound with the same setting as the current value of the CURRENT QUERY OPTIMIZATION special register.
SELECT PKGNAME, PKGSCHEMA FROM SYSCAT.PACKAGES WHERE QUERYOPT = CURRENT QUERY OPTIMIZATION
The CURRENT REFRESH AGE special register specifies a timestamp duration value with a data type of DECIMAL(20,6). This duration is the maximum duration since a REFRESH TABLE statement has been processed on a REFRESH DEFERRED summary table such that the summary table can be used to optimize the processing of a query. If CURRENT REFRESH AGE has a value of 99999999999999 (ANY), and QUERY OPTIMIZATION class is 5 or more, REFRESH DEFERRED summary tables are considered to optimize the processing of a dynamic SQL query. A summary table with the REFRESH IMMEDIATE attribute and not in check pending state is assumed to have a refresh age of zero.
Its value can be changed by the SET CURRENT REFRESH AGE statement (see SET CURRENT REFRESH AGE). Summary tables defined with REFRESH DEFERRED are never considered by static embedded SQL queries.
The initial value of CURRENT REFRESH AGE is zero.