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

STL_MERGEJOIN

分析查询的合并联接步骤。

STL_MERGEJOIN 对所有用户可见。超级用户可以查看所有行;普通用户只能查看其自己的数据。有关更多信息,请参阅系统表和视图中的数据可见性

注意

STL_MERGEJOIN 仅包含在主集群上运行的查询。它不包含在并发扩展集群上运行的查询。要访问在主集群和并发扩展集群上运行的查询,我们建议您使用 SYS 监控视图 SYS_QUERY_DETAIL。SYS 监控视图中的数据经过格式化处理,便于使用和理解。

表列

列名称 数据类型 描述
userid integer 生成该条目的用户 ID。
query integer 查询 ID。查询列可用于连接其他系统表和视图。
slice integer 标识运行查询所在切片的标识符。
segment integer 标识查询区段的数字。
step integer 运行的查询步骤。
starttime 时间戳 查询开始的时间(采用 UTC 表示)。总时间包括排队和执行时间。秒的小数部分以 6 位精度表示。例如:2009-06-12 11:29:19.131358
endtime 时间戳 查询完成的时间(采用 UTC 表示)。总时间包括排队和执行时间。秒的小数部分以 6 位精度表示。例如:2009-06-12 11:29:19.131358
tasknum 整数 分配用于运行步骤的查询任务进程的数量。
rows bigint 处理的总行数。
tbl integer 表 ID。这是合并联接中使用的内部表的 ID。
checksum bigint 此信息仅供内部使用。

示例查询

以下示例返回最近查询的合并联接结果。

select sum(s.qtysold), e.eventname from event e, listing l, sales s where e.eventid=l.eventid and l.listid= s.listid group by e.eventname; select * from stl_mergejoin where query=pg_last_query_id();
userid | query | slice | segment | step | starttime | endtime | tasknum | rows | tbl --------+-------+-------+---------+------+---------------------+---------------------+---------+------+----- 100 | 27399 | 3 | 4 | 4 | 2013-10-02 16:30:41 | 2013-10-02 16:30:41 | 19 |43428 | 240 100 | 27399 | 0 | 4 | 4 | 2013-10-02 16:30:41 | 2013-10-02 16:30:41 | 19 |43159 | 240 100 | 27399 | 2 | 4 | 4 | 2013-10-02 16:30:41 | 2013-10-02 16:30:41 | 19 |42778 | 240 100 | 27399 | 1 | 4 | 4 | 2013-10-02 16:30:41 | 2013-10-02 16:30:41 | 19 |43091 | 240