Neoview Workload Management Services Guide (R2.4)
ADD RULE COMP COMPRULE4 (AND,
EST_TOTAL_TIME >= 10,
EST_TOTAL_TIME <= 20,
NUM_JOINS > 4,
WARN-HIGH,
HOLD) COMMENT "Created by DBA on 5/14/2009";
In this example, all three compilation rule expressions must evaluate to true for the compilation
rule, COMPRULE4, to be considered true.
For the syntax of the compilation rule expressions, see the “ADD RULE COMP Command”
(page 83). For more information about the AND operator, see “Specifying the AND or OR
Operator” (page 54).
Specifying the AND or OR Operator
If the rule has only one expression, the expression must be true for the rule to trigger a warning
level or an action. For example, this ADD RULE COMP command defines a compilation rule
that sets the warning level to medium if the UPDATE_STATS_WARNING expression, highlighted
in boldface, evaluates to true:
ADD RULE COMP COMPRULE6 (UPDATE_STATS_WARNING,
WARN-MEDIUM) COMMENT "Created by DBA on 5/14/2009";
UPDATE_STATS_WARNING evaluates to true when the compiler detects missing statistics for
a single-column group.
If the rule that has more than one expression, the operator, AND or OR, determines whether all
the expressions or a single expression in the rule must be true for the rule to trigger a warning
level or an action.
If the operator is AND, all expressions in the rule must be true for the rule to be considered true
and trigger a warning level or an action. For example, this ADD RULE COMP command defines
a compilation rule that is considered true only when all three compilation rule expressions,
highlighted in boldface, evaluate to true:
ADD RULE COMP COMPRULE4 (AND,
EST_TOTAL_TIME >= 10,
EST_TOTAL_TIME <= 20,
NUM_JOINS > 4,
WARN-HIGH,
HOLD) COMMENT "Created by DBA on 5/14/2009";
If the operator is OR, only one of the expressions in the rule must be true for the rule to be
considered true and trigger a warning level or an action. For example, this ADD RULE COMP
command defines a compilation rule that is considered true when at least one of the six
compilation rule expressions, highlighted in boldface, evaluates to true:
ADD RULE COMP COMPRULE5 (OR,
EST_TOTAL_MEMORY > 320000,
EST_CARDINALITY >= 1000000,
EST_ACCESSED_ROWS > 20000,
EST_USED_ROWS > 20000,
SCAN_SIZE > 10000,
CROSS_PRODUCT,
NO-WARN,
REJECT) COMMENT "Created by DBA on 5/14/2009";
If you do not specify an operator, AND is the default operator.
Specifying a Warning Level for the Compilation Rule
You can specify a warning level for the compilation rule, so WMS sets a warning level and saves
warning information for the query when the compilation rule evaluates to true. Choose one of
these warning levels from highest to lowest severity:
54 Configuring Rules