SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION statement

The SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION statement changes the value of the CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register.

Invocation for SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.

Authorization for SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION

None required.

Syntax for SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION

Read syntax diagramSkip visual syntax diagramSET CURRENT MAINTAINEDTABLETYPESFOR OPTIMIZATION=ALLNONESYSTEMUSERhost-variable

Description for SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION

The value indicates which materialized query tables that are enabled for optimization are considered when optimizing the processing of dynamic SQL queries.

ALL
Indicates that all materialized query tables will be considered.
NONE
Indicates that no materialized query tables will be considered.
SYSTEM
Indicates that only system-maintained materialized query tables that are refresh deferred will be considered.
USER
Indicates that only user-maintained materialized query tables that are refresh deferred will be considered.
host-variable
A variable of type CHAR or VARCHAR. The length of the contents of host-variable must not exceed 255 bytes. It cannot be set to null. If host-variable has an associated indicator variable, the value of that indicator variable must not indicate a null value.

The characters of host-variable must be left justified. The content of the host variable must be a string that would match what can be specified as keywords for the special register in the exact case intended as there is no conversion to uppercase characters.

Notes for SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION

The CURRENT REFRESH AGE special register needs to be set to a value other than zero in order for the specified types of objects to be considered for optimizing the processing of dynamic SQL queries.

The CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register affects dynamic statement cache matching.

Examples for SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION

Example 1: The following statement sets the CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register:
   SET CURRENT MAINTAINED TABLE TYPES ALL;
Example 2: The following example retrieves the current value of the CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register into the host variable called CURMAINTYPES.
   EXEC SQL VALUES (CURRENT MAINTAINED TABLE TYPES) INTO :CURMAINTYPES;
The value would be ALL if set by the previous example.
Example 3: The following example resets the CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register so that no materialized query tables can be considered to optimize the processing of dynamic SQL queries.
  SET CURRENT MAINTAINED TABLE TYPES NONE;