Neoview Workload Management Services Guide (R2.4)

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 51)
Adding a Compilation Rule” (page 53)
“Displaying the Definition of a Compilation Rule” (page 56)
“Displaying the Definitions of All Compilation Rules” (page 56)
Altering a Compilation Rule” (page 56)
“Deleting a Compilation Rule” (page 57)
Associating Compilation Rules With a Service” (page 57)
“Displaying the Compilation Rules Associated With a Service” (page 57)
“Displaying the Services Associated With a Compilation Rule” (page 58)
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 4-3
(page 52).
Compilation Rules 51