Skip to content

sys.query_rule_event

This view captures information about WLM rule processing (as also displayed in Yellowbrick Manager). A single row identifies a unique rule-processing event for a specific query. Use this view to see which rules and related actions are in effect when specific queries are run.

Column NameData TypeDescription
query_idbigintQuery ID, which can be joined with the query_id column in sys.log_query or sys.query.
rule_nametextName of the WLM rule being applied. The default value of rule appears in this column for begin and end event types.
event_timetimestamptzWhen each event occurred.
event_typetextPossible values for each event are begin, disabled, end, error, ignore, info, move, set, timeout, warn
group_timestamptimestamptzTimestamp for a group of rules that are run for a query during a given state in its life cycle.
group_indexintegerIndex number that defines the order of rules that are run for a given group (0 to n).
eventtextRule processing events include Rule processing starting, Rule processing complete, Setting..., Move to resource pool..., Rule is disabled, and so on.

Examples

Return all rule events for a specific query:

premdb=> select * from sys.query_rule_event where query_id=23177566;
 query_id |             rule_name              |          event_time           | event_type |        group_timestamp        | group_index |                           event                            
----------+------------------------------------+-------------------------------+------------+-------------------------------+-------------+------------------------------------------------------------
 23177566 | rule                               | 2022-09-15 15:28:56.595608-07 | begin      | 2022-09-15 15:28:56.595699-07 |           0 | Rule [completion] processing for 23177566 starting
 23177566 | default_logLongRunningQuery        | 2022-09-15 15:28:56.595611-07 | disabled   | 2022-09-15 15:28:56.595699-07 |           1 | Rule is disabled
 23177566 | global_setupYMWorkDone             | 2022-09-15 15:28:56.595691-07 | info       | 2022-09-15 15:28:56.595699-07 |           2 | Rule changed no query settings
 23177566 | rule                               | 2022-09-15 15:28:56.595698-07 | end        | 2022-09-15 15:28:56.595699-07 |           3 | Rule [completion] processing for 23177566 complete
 23177566 | rule                               | 2022-09-15 15:28:48.616755-07 | begin      | 2022-09-15 15:28:48.617378-07 |           0 | Rule [compile] processing for 23177566 starting
 23177566 | default_cancelAfterOneMinute       | 2022-09-15 15:28:48.616756-07 | disabled   | 2022-09-15 15:28:48.617378-07 |           1 | Rule is disabled
 23177566 | default_superUserToAdmin           | 2022-09-15 15:28:48.616759-07 | ignore     | 2022-09-15 15:28:48.617378-07 |           2 | Rule configured for superuser queries (query user: super1)
 23177566 | global_throttleExternalTables      | 2022-09-15 15:28:48.616843-07 | info       | 2022-09-15 15:28:48.617378-07 |           3 | Rule changed no query settings
 23177566 | global_throttleReplication         | 2022-09-15 15:28:48.616865-07 | ignore     | 2022-09-15 15:28:48.617378-07 |           4 | Rule configured for superuser queries (query user: super1)
 23177566 | default_barToSystem                | 2022-09-15 15:28:48.616866-07 | ignore     | 2022-09-15 15:28:48.617378-07 |           5 | Rule configured for superuser queries (query user: super1)
 23177566 | default_mapToSmall                 | 2022-09-15 15:28:48.616907-07 | info       | 2022-09-15 15:28:48.617378-07 |           6 | Rule changed no query settings
 23177566 | global_mapAAToLowPriority          | 2022-09-15 15:28:48.61691-07  | ignore     | 2022-09-15 15:28:48.617378-07 |           7 | Rule configured for superuser queries (query user: super1)
 23177566 | global_setupDCSWork                | 2022-09-15 15:28:48.61691-07  | ignore     | 2022-09-15 15:28:48.617378-07 |           8 | Rule configured for superuser queries (query user: super1)
 23177566 | global_setupSMCWork                | 2022-09-15 15:28:48.616911-07 | ignore     | 2022-09-15 15:28:48.617378-07 |           9 | Rule configured for superuser queries (query user: super1)
 23177566 | global_setupSystemWork             | 2022-09-15 15:28:48.616912-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          10 | Rule configured for superuser queries (query user: super1)
 23177566 | global_setupYMWork                 | 2022-09-15 15:28:48.616944-07 | info       | 2022-09-15 15:28:48.617378-07 |          11 | Rule changed no query settings
 23177566 | global_setupStatsWork              | 2022-09-15 15:28:48.616946-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          12 | Rule configured for superuser queries (query user: super1)
 23177566 | default_dropTableToAdmin           | 2022-09-15 15:28:48.617167-07 | info       | 2022-09-15 15:28:48.617378-07 |          13 | Rule changed no query settings
 23177566 | global_mapAnalyzeToSystem          | 2022-09-15 15:28:48.61717-07  | ignore     | 2022-09-15 15:28:48.617378-07 |          14 | Rule configured for superuser queries (query user: super1)
 23177566 | global_mapFlusherToSystem          | 2022-09-15 15:28:48.617171-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          15 | Rule configured for superuser queries (query user: super1)
 23177566 | global_mapGCToSystem               | 2022-09-15 15:28:48.617172-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          16 | Rule configured for superuser queries (query user: super1)
 23177566 | global_mapParityToSystem           | 2022-09-15 15:28:48.617173-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          17 | Rule configured for superuser queries (query user: super1)
 23177566 | global_restartErrorPolicy          | 2022-09-15 15:28:48.61723-07  | set        | 2022-09-15 15:28:48.617378-07 |          18 | Setting ErrorRecoverable to true
 23177566 | global_restartErrorPolicySuperuser | 2022-09-15 15:28:48.617235-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          19 | Rule configured for superuser queries (query user: super1)
 23177566 | global_setupReplicatorWork         | 2022-09-15 15:28:48.617236-07 | ignore     | 2022-09-15 15:28:48.617378-07 |          20 | Rule configured for superuser queries (query user: super1)
 23177566 | global_defaultRowLimit             | 2022-09-15 15:28:48.61737-07  | set        | 2022-09-15 15:28:48.617378-07 |          21 | Setting MaximumRowLimit to 5000000
 23177566 | rule                               | 2022-09-15 15:28:48.617376-07 | end        | 2022-09-15 15:28:48.617378-07 |          22 | Rule [compile] processing for 23177566 complete
 23177566 | rule                               | 2022-09-15 15:28:48.613373-07 | begin      | 2022-09-15 15:28:48.613981-07 |           0 | Rule [submit] processing for 23177566 starting
 23177566 | global_throttleConcurrentQueries   | 2022-09-15 15:28:48.613521-07 | throttle   | 2022-09-15 15:28:48.613981-07 |           1 | Throttle 500 accesses
 23177566 | urgent_reports_rule                | 2022-09-15 15:28:48.61397-07  | info       | 2022-09-15 15:28:48.613981-07 |           2 | Rule changed no query settings
 23177566 | rule                               | 2022-09-15 15:28:48.613977-07 | end        | 2022-09-15 15:28:48.613981-07 |           3 | Rule [submit] processing for 23177566 complete
(31 rows)

Join sys.query_rule_event to sys.log_query and return results based on specific query text:

premdb=> select s1.query_id, s1.query_text, s2.rule_name, s2.event_type, s2.event
from sys.log_query s1, sys.query_rule_event s2
where s1.query_id=s2.query_id and query_text ='select * from match;';
 query_id |      query_text      |             rule_name              | event_type |                           event                            
----------+----------------------+------------------------------------+------------+------------------------------------------------------------
 23259120 | select * from match; | rule                               | begin      | Rule [completion] processing for 23259120 starting
 23259120 | select * from match; | default_logLongRunningQuery        | disabled   | Rule is disabled
 23259120 | select * from match; | global_setupYMWorkDone             | info       | Rule changed no query settings
 23259120 | select * from match; | rule                               | end        | Rule [completion] processing for 23259120 complete
 23259120 | select * from match; | rule                               | begin      | Rule [compile] processing for 23259120 starting
 23259120 | select * from match; | default_cancelAfterOneMinute       | disabled   | Rule is disabled
 23259120 | select * from match; | default_superUserToAdmin           | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_throttleExternalTables      | info       | Rule changed no query settings
 23259120 | select * from match; | global_throttleReplication         | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | default_barToSystem                | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | default_mapToSmall                 | set        | Setting ResourcePool to small
 23259120 | select * from match; | global_mapAAToLowPriority          | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_setupDCSWork                | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_setupSMCWork                | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_setupSystemWork             | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_setupYMWork                 | info       | Rule changed no query settings
 23259120 | select * from match; | global_setupStatsWork              | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | default_dropTableToAdmin           | info       | Rule changed no query settings
 23259120 | select * from match; | global_mapAnalyzeToSystem          | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_mapFlusherToSystem          | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_mapGCToSystem               | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_mapParityToSystem           | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_restartErrorPolicy          | set        | Setting ErrorRecoverable to true
 23259120 | select * from match; | global_restartErrorPolicySuperuser | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_setupReplicatorWork         | ignore     | Rule configured for superuser queries (query user: super1)
 23259120 | select * from match; | global_defaultRowLimit             | set        | Setting MaximumRowLimit to 5000000
 23259120 | select * from match; | rule                               | end        | Rule [compile] processing for 23259120 complete
 23259120 | select * from match; | rule                               | begin      | Rule [submit] processing for 23259120 starting
 23259120 | select * from match; | global_throttleConcurrentQueries   | throttle   | Throttle 500 accesses
 23259120 | select * from match; | urgent_reports_rule                | info       | Rule changed no query settings
 23259120 | select * from match; | rule                               | end        | Rule [submit] processing for 23259120 complete
(31 rows)

The following example filters events in which a query was moved to another pool:

yellowbrick=# select query_id, rule_name, event_time, event_type, event
from sys.query_rule_event where event like 'Move%';
 query_id |    rule_name    |         event_time         | event_type |           event            
----------+-----------------+----------------------------+------------+----------------------------
 13450004 | system          | 2022-08-24 14:39:59.967-07 | move       | Move to resource pool long
 13245785 | flex_moveToLong | 2022-08-24 12:35:18.543-07 | move       | Move to resource pool long
(2 rows)

The following example finds events for a specific completion rule when it was not disabled or ignored:

yellowbrick=# select query_id, rule_name, event_time, event_type, event 
from sys.query_rule_event 
where rule_name='completion_error' and event_type not in('ignore','disabled');
 query_id |    rule_name     |         event_time         | event_type |                event                 
----------+------------------+----------------------------+------------+--------------------------------------
 13584534 | completion_error | 2020-09-24 15:59:05.644-07 | error      | Do not use the yellowbrick database!
 13583194 | completion_error | 2020-09-24 15:58:50.191-07 | error      | Do not use the yellowbrick database!
 13580925 | completion_error | 2020-09-24 15:57:36.721-07 | error      | Do not use the yellowbrick database!
 13579296 | completion_error | 2020-09-24 15:57:13.002-07 | info       | Rule changed no query settings
 13578087 | completion_error | 2020-09-24 15:57:08.935-07 | error      | Do not use the yellowbrick database!
 13577467 | completion_error | 2020-09-24 15:56:27.999-07 | info       | Rule changed no query settings
...