SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION
The SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION statement changes the value of the CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register.
Invocation
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
Authorization
None required.
Syntax
.-TABLE-. >>-SET CURRENT MAINTAINED--+-------+--TYPES---------------------> .-FOR OPTIMIZATION-. .-=-. >--+------------------+--+---+--+-ALL--------------+----------->< +-NONE-------------+ +-SYSTEM-----------+ +-+-SESSION_USER-+-+ | '-USER---------' | '-host-variable----'
Description
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.
- SESSION_USER or 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
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
SET CURRENT MAINTAINED TABLE TYPES ALL;
EXEC SQL VALUES (CURRENT MAINTAINED TABLE TYPES) INTO :CURMAINTYPES;
The
value would be ALL if set by the previous example. SET CURRENT MAINTAINED TABLE TYPES NONE;