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

STL_SAVE

Contains details for save steps in queries. A save step saves the input stream to a transient table. A transient table is a temporary table that stores intermediate results during query execution.

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

STL_SAVE 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.
tbl integer ID of the materialized transient table.
is_diskbased character(1) Whether this step of the query was executed as a disk-based operation: true (t) or false (f).
workmem bigint Number of bytes of working memory assigned to the step.

Sample Queries

The following query shows which save steps in the most recent query were executed on each slice.

Copy
select query, slice, segment, step, tasknum, rows, tbl from stl_save where query = pg_last_query_id(); query | slice | segment | step | tasknum | rows | tbl -------+-------+---------+------+---------+------+----- 52236 | 3 | 0 | 2 | 21 | 0 | 239 52236 | 2 | 0 | 2 | 20 | 0 | 239 52236 | 2 | 2 | 2 | 20 | 0 | 239 52236 | 3 | 2 | 2 | 21 | 0 | 239 52236 | 1 | 0 | 2 | 21 | 0 | 239 52236 | 0 | 0 | 2 | 20 | 0 | 239 52236 | 0 | 2 | 2 | 20 | 0 | 239 52236 | 1 | 2 | 2 | 21 | 0 | 239 (8 rows)