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

STL_RETURN

Contains details for return steps in queries. A return step returns the results of queries executed on the compute nodes to the leader node. The leader node then merges the data and returns the results to the requesting client. For queries executed on the leader node, a return step returns results to the client.

A query consists of multiple segments, and each segment consists of one or more steps. For more information, see Query Processing.

STL_RETURN 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 query shows which steps in the most recent query were executed on each slice. (Slice 10000 is on the leader node.)

Copy
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 | 10000| 4 | 1 | 2013-12-27 01:43:21.480755 | 0 | 0 (7 rows)