Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

STL_DIST

Logs information about network activity during execution of query steps that distribute data. Network traffic is captured by numbers of rows, bytes, and packets that are sent over the network during a given step on a given slice. The duration of the step is the difference between the logged start and end times.

To identify distribution steps in a query, look for dist labels in the QUERY_SUMMARY view or run the EXPLAIN command and then look for step attributes that include dist.

This table is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of Data in System Tables and Views.

Table Columns

Column Name Data Type Description
userid integer ID of the user who generated the entry.
query integer Query ID. The query column can be used to join other system tables and views.
slice integer Number that identifies the slice where the query was running.
segment integer Number that identifies the query segment.
step integer Query step that executed.
starttime timestamp Time in UTC that the query started executing, with 6 digits of precision for fractional seconds. For example: 2009-06-12 11:29:19.131358.
endtime timestamp Time in UTC that the query finished executing, with 6 digits of precision for fractional seconds. For example: 2009-06-12 11:29:19.131358.
tasknum integer Number of the query task process that was assigned to execute the step.
rows bigint Total number of rows that were processed.
bytes bigint Size, in bytes, of all the output rows for the step.
packets integer Total number of packets sent over the network.

Sample Queries

The following example returns distribution information for queries with one or more packets and duration greater than zero.

Copy
select query, slice, step, rows, bytes, packets, datediff(seconds, starttime, endtime) as duration from stl_dist where packets>0 and datediff(seconds, starttime, endtime)>0 order by query limit 10;

Copy
query | slice | step | rows | bytes | packets | duration --------+-------+------+--------+---------+---------+----------- 567 | 1 | 4 | 49990 | 6249564 | 707 | 1 630 | 0 | 5 | 8798 | 408404 | 46 | 2 645 | 1 | 4 | 8798 | 408404 | 46 | 1 651 | 1 | 5 | 192497 | 9226320 | 1039 | 6 669 | 1 | 4 | 192497 | 9226320 | 1039 | 4 675 | 1 | 5 | 3766 | 194656 | 22 | 1 696 | 0 | 4 | 3766 | 194656 | 22 | 1 705 | 0 | 4 | 930 | 44400 | 5 | 1 111525 | 0 | 3 | 68 | 17408 | 2 | 1 (9 rows)