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

STL_HASH

Analyzes hash execution steps for queries.

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.
slots integer Total number of hash buckets.
occupied integer Total number of slots that contain records.
maxlength integer Size of the largest slot.
tbl integer Table ID.
is_diskbased character(1) If true (t), the query was executed as a disk-based operation. If false (f), the query was executed in memory.
workmem bigint Total number of bytes of working memory assigned to the step.
num_parts integer Total number of partitions that a hash table was divided into during a hash step. A hash table is partitioned when it is estimated that the entire hash table might not fit into memory.
est_rows bigint Estimated number of rows to be hashed.
num_blocks_permitted integer This information is for internal use only.
row_dist_variance integer This information is for internal use only.

Sample Queries

The following example returns information about the number of partitions that were used in a hash for query 720, and indicates that none of the steps ran on disk.

Copy
select slice, rows, bytes, occupied, workmem, num_parts, est_rows, num_blocks_permitted from stl_hash where query=720 and segment=5 order by slice;

Copy
slice | rows | bytes | occupied | workmem | num_parts | est_rows | num_blocks_permitted -------+------+--------+----------+----------+-----------+----------+---------------------- 0 | 145 | 585800 | 1 | 88866816 | 16 | 1 | 52 1 | 0 | 0 | 0 | 0 | 16 | 1 | 52 (2 rows)