

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 Python UDF。现有的 Python UDF 将继续正常运行至 2026 年 6 月 30 日。有关更多信息，请参阅[博客文章](https://www.amazonaws.cn/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

# SVL\_QUERY\_QUEUE\_INFO
<a name="r_SVL_QUERY_QUEUE_INFO"></a>

总结查询在工作负载管理 (WLM) 查询队列或提交队列中花费时间的详细信息。

SVL\_QUERY\_QUEUE\_INFO 视图筛选系统执行的查询并且只显示用户执行的查询。

SVL\_QUERY\_QUEUE\_INFO 视图总结 [STL\_QUERY](r_STL_QUERY.md)、[STL\_WLM\_QUERY](r_STL_WLM_QUERY.md) 和 [STL\_COMMIT\_STATS](r_STL_COMMIT_STATS.md) 系统表的信息。

SVL\_QUERY\_QUEUE\_INFO 仅对超级用户可见。有关更多信息，请参阅 [系统表和视图中的数据可见性](cm_chap_system-tables.md#c_visibility-of-data)。

## 表列
<a name="r_SVL_QUERY_QUEUE_INFO-table-columns"></a>


| 列名称  | 数据类型  | 描述  | 
| --- | --- | --- | 
| 数据库 | text | 在发起查询时用户连接到的数据库的名称。 | 
| query | integer | 查询 ID。 | 
| xid  | bigint  | 事务 ID。 | 
| userid | integer | 生成该查询的用户的 ID。 | 
| querytxt | text | 查询文本的前 100 个字符。 | 
| queue\_start\_time | timestamp | 查询进入 WLM 队列的时间（UTC 时间）。 | 
| exec\_start\_time | timestamp | 开始执行查询的时间（UTC 时间）。 | 
| service\_class | integer | 服务类的 ID。服务类在 WLM 配置文件中进行定义。 | 
| slots | integer | WLM 查询槽位数。 | 
| queue\_elapsed | bigint | 查询在 WLM 队列中等待所花费的时间（单位为秒）。 | 
| exec\_elapsed | bigint | 执行查询所花费的时间（单位为秒）。 | 
| wlm\_total\_elapsed | bigint | 查询在 WLM 队列中花费的时间 (queue\_elapsed) 加上执行该查询所花费的时间 (exec\_elapsed)。 | 
| commit\_queue\_elapsed | bigint | 查询在提交队列中等待所花费的时间（单位为秒）。 | 
| commit\_exec\_time | bigint | 查询在提交操作中所花费的时间（单位为秒）。 | 
| service\_class\_name | character(64) | 服务类的名称。 | 

## 示例查询
<a name="r_SVL_QUERY_QUEUE_INFO-sample-queries"></a>

下面的示例显示查询在 WLM 队列中所花费的时间。

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