STL_COMMIT_STATS - Amazon Redshift
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

STL_COMMIT_STATS

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

STL_COMMIT_STATS 仅对超级用户可见。有关更多信息,请参阅系统表和视图中的数据可见性

此表中的部分或全部数据也可以在 SYS 监控视图 SYS_TRANSACTION_HISTORY 中找到。SYS 监控视图中的数据经过格式化处理,便于使用和理解。我们建议您使用 SYS 监控视图进行查询。

表列

列名称 数据类型 描述
xid bigint 所提交的事务 ID。
node integer 节点编号。-1 是领导节点。
startqueue timestamp 提交的队列的开始时间。
startwork timestamp 提交的开始时间。
endflush timestamp 脏数据块刷新阶段的结束时间。
endstage timestamp 元数据暂存阶段的结束时间。
endlocal timestamp 本地提交阶段的结束时间。
startglobal timestamp 全局阶段的开始时间。
endtime timestamp 提交的结束时间。
queuelen bigint 提交队列中位于此事务之前的事务数。
permblocks bigint 此次提交时现有永久性数据块的数量。
newblocks bigint 此次提交时新的永久性数据块的数量。
dirtyblocks bigint 必须作为此提交的一部分写入的数据块的数量。
headers bigint 必须作为此提交的一部分写入的数据块标头的数量。
numxids integer 活动 DML 事务的数量。
oldestxid bigint 最旧的活动 DML 事务的 XID。
extwritelatency bigint 此信息仅供内部使用。
metadatawritten int 此信息仅供内部使用。
tombstonedblocks bigint 此信息仅供内部使用。
tossedblocks bigint 此信息仅供内部使用。
batched_by bigint 此信息仅供内部使用。

示例查询

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