The OPTGUIDELINES element of a statement profile defines
the optimization guidelines in effect for the statement that is identified
by the associated statement key. It is defined by the type optGuidelinesType.
XML Schema
<xs:element name="OPTGUIDELINES" type="optGuidelinesType"/>
<xs:complexType name="optGuidelinesType">
<xs:sequence>
<xs:group ref="general request" minOccurs="0" maxOccurs="1"/>
<xs:choice maxOccurs="unbounded">
<xs:group ref="rewriteRequest"/>
<xs:group ref="accessRequest"/>
<xs:group ref="joinRequest"/>
<xs:group ref="mqtEnforcementRequest"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
Description
The optGuidelinesType group
defines the set of valid sub-elements of the OPTGUIDELINES element.
Each sub-element is interpreted as an optimization guideline by the DB2® optimizer. Sub-elements can
be categorized as either general request elements, rewrite request
elements, access request elements, or join request elements.
- General request elements are used to specify general
optimization guidelines, which can be used to change the optimizer's
search space.
- Rewrite request elements are used to specify query
rewrite optimization guidelines, which can be used to affect the query
transformations that are applied when the optimized statement is being
determined.
- Access request elements and join request elements are
plan optimization guidelines, which can be used to affect access methods,
join methods, and join orders that are used in the execution plan
for the optimized statement.
- MQT enforcement request elements specify semantically
matchable materialized query tables (MQTs) whose use in access plans
should be enforced regardless of cost estimates.
Note: Optimization guidelines that are specified in a statement
profile take precedence over those that are specified in the global
section of an optimization profile.