Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

STV_WLM_SERVICE_CLASS_STATE

Contains the current state of the service classes.

STV_WLM_SERVICE_CLASS_STATE is visible only to superusers. For more information, see Visibility of Data in System Tables and Views.

Table Columns

Column Name Data Type Description
service_class integer ID for the service class. Service classes are defined in the WLM configuration.
num_queued_queries integer Number of queries currently in the queue.
num_executing_queries integer Number of queries currently executing.
num_serviced_queries integer Number of queries that have ever been in the service class.
num_executed_queries integer Number of queries to have executed since Amazon Redshift was initialized.
num_restarted_queries integer Number of queries that have restarted since Amazon Redshift was initialized.

Sample Query

Service classes 1 - 4 are used internally by Amazon Redshift, and service class 5 is reserved for the dedicated superuser queue. The following query displays the state for service classes greater than 5, which are the WLM query queues.

Copy
select service_class, num_executing_queries, num_executed_queries from stv_wlm_service_class_state where service_class > 5 order by service_class;
Copy
service_class | num_executing_queries | num_executed_queries ---------------+-----------------------+---------------------- 6 | 1 | 222 7 | 0 | 135 8 | 1 | 39 (3 rows)

On this page: