STL_HASHJOIN - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

STL_HASHJOIN

Analyzes hash join execution steps for queries.

STL_HASHJOIN 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.

Note

STL_HASHJOIN only contains queries run on main provisioned clusters. It doesn't contain queries run on concurrency scaling clusters or on serverless namespaces. To access explain plans for queries run on both main clusters, concurrency scaling clusters, and serverless namespaces, we recommend that you use the SYS monitoring view SYS_QUERY_DETAIL . The data in the SYS monitoring view is formatted to be easier to use and understand.

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 ran.
starttime timestamp Time in UTC that the query started. Total time includes queuing and execution. 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. Total time includes queuing and execution. 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 run the step.
rows bigint Total number of rows that were processed.
tbl integer Table ID.
num_parts integer Total number of partitions that a hash table was divided into during a hash step.
join_type integer The type of join for the step:
  • 0. The query used an inner join.

  • 1. The query used a left outer join.

  • 2. The query used a full outer join.

  • 3. The query used a right outer join.

  • 4. The query used a UNION operator.

  • 5. The query used an IN condition.

  • 6. This information is for internal use only.

  • 7. This information is for internal use only.

  • 8. This information is for internal use only.

  • 9. This information is for internal use only.

  • 10. This information is for internal use only.

  • 11. This information is for internal use only.

  • 12. This information is for internal use only.

hash_looped character(1) This information is for internal use only.
switched_parts character(1) Indicates whether the build (or outer) and probe (or inner) sides have switched.
used_prefetching character(1) This information is for internal use only.
hash_segment integer The segment of the corresponding hash step.
hash_step integer The step number of the corresponding hash step.
checksum bigint This information is for internal use only.
distribution integer This information is for internal use only.

Sample queries

The following example returns the number of partitions used in a hash join for query 720.

select query, slice, tbl, num_parts from stl_hashjoin where query=720 limit 10;
query | slice | tbl | num_parts -------+-------+-----+----------- 720 | 0 | 243 | 1 720 | 1 | 243 | 1 (2 rows)