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

STV_WLM_QUERY_QUEUE_STATE

Records the current state of the query queues for the service classes.

STV_WLM_QUERY_QUEUE_STATE is visible to all users. Superusers can see all rows; regular users can see only their own data. 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.
position integer Position of the query in the queue. The query with the smallest position value runs next.
task integer ID used to track a query through the workload manager. Can be associated with multiple query IDs. If a query is restarted, the query is assigned a new query ID but not a new task ID.
query integer Query ID. If a query is restarted, the query is assigned a new query ID but not a new task ID.
slot_count integer Number of WLM query slots.
start_time timestamp Time that the query entered the queue.
queue_time bigint Number of microseconds that the query has been in the queue.

Sample Query

The following query shows the queries in the queue for service classes greater than 4.

Copy
select * from stv_wlm_query_queue_state where service_class > 4 order by service_class;

This query returns the following sample output.

Copy
service_class | position | task | query | slot_count | start_time | queue_time ---------------+----------+------+-------+------------+----------------------------+------------ 5 | 0 | 455 | 476 | 5 | 2010-10-06 13:18:24.065838 | 20937257 6 | 1 | 456 | 478 | 5 | 2010-10-06 13:18:26.652906 | 18350191 (2 rows)

On this page: