Neoview Workload Management Services Guide (R2.5)

Compilation Rules
Compilation rules, which are applied after a query is prepared, determine whether to permit the
query to start executing, put the query on hold, or reject the query, based on the compiler estimates
for the query.
This section covers:
“How WMS Evaluates Compilation Rules” (page 84)
“Display the Compilation Rules Summary” (page 86)
Add a Compilation Rule” (page 87)
Alter a Compilation Rule” (page 94)
“Delete a Compilation Rule” (page 96)
Associate Compilation Rules With a Service” (page 97)
NOTE: When query statistics aggregation is enabled for a service, WMS does not apply
compilation rules.
How WMS Evaluates Compilation Rules
After the NDCS server prepares a query, it sends the compiler estimates to WMS in a “would
like to execute” request. WMS compares the compiler estimates for the query against the
compilation rules set for the service to determine what actions, if any, to take regarding the query.
The following example illustrates how WMS evaluates the compilation rules against the compiler
estimates.
Suppose you defined these compilation rules for the service that is associated with the prepared
query:
ADD RULE COMP COMPRULE1 (EST_USED_ROWS > 50000, WARN-HIGH, REJECT);
ADD RULE COMP COMPRULE2 (EST_USED_ROWS > 25000, WARN-MEDIUM, HOLD);
ADD RULE COMP COMPRULE3 (EST_USED_ROWS > 1000, WARN-LOW);
ALTER SERVICE SERVICE1 COMP (COMPRULE1, COMPRULE2, COMPRULE3);
WMS evaluates each compilation rule in the order in which you have associated the compilation
rules with the service in the ALTER SERVICE COMP command. WMS evaluates the first
compilation rule associated with the service by comparing each compilation rule expression with
the corresponding compiler estimate for the query. In this case, COMPRULE1 has only one
compilation rule expression, which requires the estimated rows used to be greater than 50,000:
EST_USED_ROWS > 50000
Because the compiler estimate of 33,500 rows does not meet the criterion of the compilation rule
expression, WMS considers the compilation rule, COMPRULE1, to be false. See Figure 5-3
(page 85).
84 Configuring Rules