

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# STV\$1WLM\$1QUERY\$1QUEUE\$1STATE
<a name="r_STV_WLM_QUERY_QUEUE_STATE"></a>

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

STV\$1WLM\$1QUERY\$1QUEUE\$1STATE 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](cm_chap_system-tables.md#c_visibility-of-data).

Some or all of the data in this table can also be found in the SYS monitoring view [SYS\$1QUERY\$1HISTORY](SYS_QUERY_HISTORY.md). The data in the SYS monitoring view is formatted to be easier to use and understand. We recommend that you use the SYS monitoring view for your queries.

## Table columns
<a name="r_STV_WLM_QUERY_QUEUE_STATE-table-columns2"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/r_STV_WLM_QUERY_QUEUE_STATE.html)

## Sample query
<a name="r_STV_WLM_QUERY_QUEUE_STATE-sample-query2"></a>

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

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

 This query returns the following sample output. 

```
 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)
```