ablog

不器用で落着きのない技術者のメモ

Redshift のリーダーノードのスライス番号

[追記]スライスに関する情報として、STV_SLICESというテーブルもあるようです。上記SQLに追記する形でノード・スライスの情報を付与してみました。(※これを見る限り、上記のスライス"6411"のような極端に大きな数字についてはリーダーノードの情報になるのでは、と推測します

Amazon Redshift: 『パフォーマンスチューニングテクニック Top 10』手順の実践(2).偏ったテーブルデータ | Developers.IO

The following query shows which steps in the most recent query were executed on each slice. (Slice 6411 is on the leader node.)

SELECT query, slice, segment, step, endtime, rows, packets 
from stl_return where query = pg_last_query_id();

 query |  slice | segment | step |          endtime           | rows | packets 
-------+--------+---------+------+----------------------------+------+---------
     4 |      2 |       3 |    2 | 2013-12-27 01:43:21.469043 |    3 |       0
     4 |      3 |       3 |    2 | 2013-12-27 01:43:21.473321 |    0 |       0
     4 |      0 |       3 |    2 | 2013-12-27 01:43:21.469118 |    2 |       0
     4 |      1 |       3 |    2 | 2013-12-27 01:43:21.474196 |    0 |       0
     4 |      4 |       3 |    2 | 2013-12-27 01:43:21.47704  |    2 |       0
     4 |      5 |       3 |    2 | 2013-12-27 01:43:21.478593 |    0 |       0
     4 |    6411|       4 |    1 | 2013-12-27 01:43:21.480755 |    0 |       0
(7 rows)
https://docs.amazonaws.cn/en_us/redshift/latest/dg/r_STL_RETURN.html