Skip to content

Rule Actions

The following table lists the specific rule actions that you can trigger based on one or more conditions. Each action applies to one or more rule types.

ActionDescriptionRule TypesAccepted Values
Set Resource PoolAssign the query to a specific WLM resource pool. See also the other "Assign" rules in this table, which provide some flexibility in choosing resource pools.

Assemble, CompileSelect from the drop-down list.
Set PriorityReduce or increase the CPU priority of the query. The priority of queries is set exclusively by rules. Priority starts at Normal, and rules may set priority to a lower (Low) or a higher (High or Critical) value. See Priority Levels.Submit, Assemble, Compile, RuntimeLow, Normal, High, Critical
Set CostOverride the cost set by the planner. This action can be used to influence the behavior of subsequent rules that are applied to the same query.Assemble, Compile, RuntimeAny number
Set Lookup QueryPin the query in memory because it is likely to be run frequently.Assemble, CompileTrue or False
Set Short Query BiasA “short query” is expected to run very quickly and use resources for a very short time; therefore, it is given a temporary boost in priority to get it finished under concurrent loads.Assemble, CompileTrue or False
Set Query TagsSet query tags that will be logged for this query. See Using Query Tags.All typesAny string
Set Maximum Execution Time LimitSet a limit on the maximum execution time, in seconds. Cancel the query if the threshold is reached.Assemble, CompileAny number
Set Maximum Row LimitSet a row limit. A query is aborted with the following error if it attempts to return more than the specified number of rows:
WLM row limit exceeded


You can also set a maximum row limit for individual resource pools when you create them. Note that by default the system rule global_defaultRowLimit imposes a limit of 5,000,000 rows on non-superuser queries. Superuser queries are not subject to this limit. If necessary, you can modify (increase or decrease) this global row limit.
Assemble, CompileAny number
Set Maximum Wait LimitSet a limit, in seconds, for how long a query may wait in a WLM queue.Assemble, CompileAny number
Set Requested Memory (in megabytes) or Set Requested Memory PercentSet the requested amount of memory, either in megabytes, or as a percentage.Assemble, CompileAny number
Set Requested Temporary Space (in megabytes) or Set Requested Temporary Space PercentThe maximum spill size per slot is fixed by the WLM configuration and calculated up-front when the resource pool is configured. This size may not be exceeded by a query, and all queries get this value for their slot when they start. A WLM rule, however, can restrict spill size. To disable spilling, or allow queries to go out of memory earlier, you can set the value to a lower number. Setting a higher value results in a warning being logged.Assemble, CompileAny number
Log at INFO, DEBUG, WARN, ERRORLog a user-defined message at the specified logging level. Logging messages at WARN and ERROR levels sends a "WLM Rule Alert" to any configured alert endpoints.All typesAny string
Abort QueryCancel the query and return a message to the client that states the reason.Submit, Assemble, Compile, RuntimeAny string
Move Query to New Resource PoolMove a running query to a different resource pool. See Moving Queries.Compile, RuntimeDefault pool for profile or profile name and pool name (select from drop-down list)
Restart Query in New PoolRestart a query in a different resource pool. See Restarting QueriesCompile, RuntimeSelect from drop-down list
Store Execution StatisticsTurn on or off statistics logging to the sys.log_query view. For example, you may decide that an application that performs well does not need any statistics recorded during execution of any of its queries.All typesTrue or False
Assign Most Concurrent Resource Pool [ With Temp Space, Without Temp Space ]Assign the resource pool that has the most concurrency (execution slots). There are three variations of this rule so you can take temporary space for spilling into account.Assemble, CompileNo value required
Assign Smallest Pool for Query Estimated MemoryAssign the smallest pool that fits the specified minimum amount of memory.Assemble, CompileEnter the minimum memory value (in MB)
Assign Largest Memory Resource Pool [ With Temp Space, Without Temp Space ]Assign the resource pool that has the largest memory allocation. There are three variations of this rule so you can take temporary space for spilling into account.Assemble, CompileNo value required
Assign Largest Temporary Space Resource PoolAssign the resource pool that has the largest amount of temporary space for spilling.Assemble, CompileNo value required
Assign Least Busy Resource PoolAssign the resource pool that is the least busy when the query comes in.Assemble, CompileNo value required
Limit Concurrent QueriesLimit the number of concurrent queries that can run in a resource pool. Optionally, specify per-application, role, or user limits.Submit, Assemble, CompileNumber of queries and an optional throttle name. For example: wlm.throttle(2, w.application)

Priority Levels

Priority settings affect the behavior of queries both before they are executed and during their execution. When the system is busy and queries are queued up (waiting), queries are sent to the worker nodes for execution based on their priority (Low, Normal, High, and Critical). Resource pools maintain four different queues, one for each level. The system serves higher-priority queries before lower-priority queries, increasing the allocation of CPU time proportionally at each level by 2-3x. For example, if you have two concurrent queries, one set to Low and one set to Normal, the Normal query takes approximately 75% of the CPU time, and the Low query approximately 25% (the remainder).

During execution, priority settings are only meaningful if queries are running concurrently and incoming concurrent queries are assigned different priorities. Two queries operating at the same priority are given equal share of the system. If only one query is running, it gets 100% of the available CPU, regardless of its priority.

Parent topic:Creating WLM Rules