

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

# STL\$1COMMIT\$1STATS
<a name="r_STL_COMMIT_STATS"></a>

提供与提交性能相关的指标，包括提交的各个阶段的时间和提交的数据块的数量。查询 STL\$1COMMIT\$1STATS 以确定提交时使用的是事务的哪个部分以及出现了多少队列。

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

此表中的部分或全部数据也可以在 SYS 监控视图 [SYS\$1TRANSACTION\$1HISTORY](SYS_TRANSACTION_HISTORY.md) 中找到。SYS 监控视图中的数据经过格式化处理，便于使用和理解。我们建议您使用 SYS 监控视图进行查询。

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

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

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

```
select node, datediff(ms,startqueue,startwork) as queue_time, 
datediff(ms, startwork, endtime) as commit_time, queuelen
from stl_commit_stats
where xid = 2574
order by node;

node | queue_time   | commit_time | queuelen
-----+--------------+-------------+---------
  -1 |            0 |         617 |        0
   0 | 444950725641 |         616 |        0
   1 | 444950725636 |         616 |        0
```