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

SVL_S3QUERY_SUMMARY

Use the SVL_S3QUERY_SUMMARY view to get a summary of all Amazon Redshift Spectrum queries (S3 queries) that have been run on the system. SVL_S3QUERY_SUMMARY aggregates detail from SVL_S3QUERY at the segment level.

SVL_S3QUERY_SUMMARY 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 The ID of the user that generated the given entry.
query integer The query ID. You can use this value to join various other system tables and views.
xid long The transaction ID.
pid integer The process ID.
segment integer The segment number. A query consists of multiple segments, and each segment consists of one or more steps.
step integer The query step that executed.
starttime timestamp Time in UTC that the query started executing.
endtime timestamp Time in UTC that the query completed.
elapsed integer The length of time that it took the query to execute (in microseconds).
aborted integer If a query was aborted by the system or canceled by the user, this column contains 1. If the query ran to completion, this column contains 0.
external_table_name char(136) The internal format of name of the external name of the table for the external table scan.
is_partitioned char(1) If true (t), this column value indicates that the external table is partitioned.
is_rrscan char(1) If true (t), this column value indicates that a range-restricted scan was applied.
s3_scanned_rows long The number of rows scanned from Amazon S3 and sent to the Redshift Spectrum layer.
s3_scanned_bytes long The number of bytes scanned from Amazon S3 and sent to the Redshift Spectrum layer, based on compressed data.
s3query_returned_rows long The number of rows returned from the Redshift Spectrum layer to the cluster.
s3query_returned_bytes long The number of bytes returned from the Redshift Spectrum layer to the cluster. A large amount of data returned to Amazon Redshift might affect system performance.
files integer The number of files that were processed for this Redshift Spectrum query. A small number of files limits the benefits of parallel processing.
files_max integer The maximum number of file processed on one slice.
files_avg integer The average number of file processed on one slice.
splits int The number of splits processed for this segment. The number of splits processed on this slice. With large splitable data files, for example, data files larger than about 512 MB, Redshift Spectrum tries to split the files into multiple S3 requests for parallel processing.
splits_max int The maximum number of splits processed on this slice.
splits_avg int The average number of splits processed on this slice.
total_split_size bigint The total size of all splits processed.
max_split_size bigint The maximum split size processed, in bytes.
avg_split_size bigint The average split size processed, in bytes.
total_retries integer The total number of retries for one individual processed file.
max_retries integer The maximum number of retries for any of processed files.
max_request_duration integer The maximum duration of an individual file request (in microseconds). Long running queries might indicate a bottleneck.
avg_request_duration double precision The average duration of the file requests (in microseconds).
max_request_parallelism integer The maximum number of outstanding requests at one node slice for this Redshift Spectrum request.
avg_request_parallelism double precision The average number of parallel Redshift Spectrum requests at one slice.

Sample Query

The following example gets the scan step details for the last query executed.

Copy
select query, segment, elapsed, s3_scanned_rows, s3_scanned_bytes, s3query_returned_rows, s3query_returned_bytes, files from svl_s3query_summary where query = pg_last_query_id() order by query,segment;
query | segment | elapsed | s3_scanned_rows | s3_scanned_bytes | s3query_returned_rows | s3query_returned_bytes | files
------+---------+---------+-----------------+------------------+-----------------------+------------------------+------
 4587 |       2 |   67811 |               0 |                0 |                     0 |                      0 |     0
 4587 |       2 |  591568 |          172462 |         11260097 |                  8513 |                 170260 |     1
 4587 |       2 |  216849 |               0 |                0 |                     0 |                      0 |     0
 4587 |       2 |  216671 |               0 |                0 |                     0 |                      0 |     0