Skip to content

sys.wlm_active_rule

This view returns the currently active WLM rules and identifies the JavaScript expression for each rule and other attributes. See sys.wlm_pending_rule for a description of the columns.

Example

For example:

premdb=# select * from sys.wlm_active_rule;
 profile_name |          rule_name           | rule_type  | order | enabled | superuser |                                                     expression                                                      
--------------+------------------------------+------------+-------+---------+-----------+---------------------------------------------------------------------------------------------------------------------
 default      | default_boostForHighMemory   | runtime    |     1 | f       | f         | false && log.info('Query {} using maxMemory {}', w.execId, w.stats.maxMemory);                                     +
             |                              |            |       |         |           |                                                                                                                    +
             |                              |            |       |         |           | if (w.stats.maxMemory > (2*1024*1024*1024) && w.priority !== 'high') {                                             +
             |                              |            |       |         |           |   w.priority = 'high';                                                                                             +
             |                              |            |       |         |           |   log.error('Boosted query {} to high priority, because it is using too much memory ({} GB)',                      +
             |                              |            |       |         |           |     w.execId, (w.stats.maxMemory / (1024*1024*1024)).toFixed(1));                                                  +
             |                              |            |       |         |           | }                                                                                                                  +
             |                              |            |       |         |           | 
 default      | default_bumpLongRunningQuery | runtime    |     1 | f       | f         | false && log.info('Query {} has taken ({} ms)', w.execId, w.executionDuration);                                    +
             |                              |            |       |         |           |                                                                                                                    +
             |                              |            |       |         |           | if (w.executionDuration > 15000 && w.priority !== 'high') {                                                        +
             |                              |            |       |         |           |   log.warn('Query {} has taken too long ({} ms); setting priority to high', w.execId, w.executionDuration);        +
             |                              |            |       |         |           |   w.priority = 'high';                                                                                             +
             |                              |            |       |         |           | }                                                                                                                  +
             |                              |            |       |         |           | 
 default      | default_dropTableToAdmin     | prepare    | 10000 | f       | f         | if (String(w.SQLText).match(/^DROP\s*TABLE/i) && w.memoryEstimate < 512 && w.memoryEstimateConfidence === 'High') {+
             |                              |            |       |         |           |     w.resourcePool = 'admin';                                                                                      +
             |                              |            |       |         |           |     w.priority = 'critical';                                                                                       +
             |                              |            |       |         |           | }                                                                                                                  +
             |                              |            |       |         |           | 
...

Parent topic:System Views