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

SVL_QUERY_QUEUE_INFO

Summarizes details for queries that spent time in a workload management (WLM) query queue or a commit queue.

The SVL_QUERY_QUEUE_INFO view filters queries executed by the system and shows only queries executed by a user.

The SVL_QUERY_QUEUE_INFO view summarizes information from the STL_QUERY, STL_WLM_QUERY, and STL_COMMIT_STATS system tables.

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

Table Columns

Column Name Data Type Description
database text The name of the database the user was connected to when the query was issued.
query integer Query ID.
xid bigint Transaction ID.
userid integer ID of the user that generated the query.
querytxt text First 100 characters of the query text.
queue_start_time timestamp Time in UTC when the query entered the WLM queue.
exec_start_time timestamp Time in UTC when query execution started.
service_class integer ID for the service class. Service classes are defined in the WLM configuration file.
slots integer Number of WLM query slots.
queue_elapsed bigint Time that the query spent waiting in a WLM queue (in seconds).
exec_elapsed bigint Time spent executing the query (in seconds).
wlm_total_elapsed bigint Time that the query spent in a WLM queue (queue_elapsed), plus time spent executing the query (exec_elapsed).
commit_queue_elapsed bigint Time that the query spent waiting in the commit queue (in seconds).
commit_exec_time bigint Time that the query spent in the commit operation (in seconds).

Sample Queries

The following example shows the time that queries spent in WLM queues.

Copy
select query, service_class, queue_elapsed, exec_elapsed, wlm_total_elapsed from svl_query_queue_info where wlm_total_elapsed > 0; query | service_class | queue_elapsed | exec_elapsed | wlm_total_elapsed ---------+---------------+---------------+--------------+------------------- 2742669 | 6 | 2 | 916 | 918 2742668 | 6 | 4 | 197 | 201 (2 rows)