Redshift Observatory

System Table Tracker

System view pg_catalog.svcs_s3query version 1.0.77272 / 2024-11-01

schema name column data type
pg_catalog svcs_s3query avg_request_duration int8
pg_catalog svcs_s3query avg_request_parallelism float8
pg_catalog svcs_s3query elapsed int8
pg_catalog svcs_s3query endtime timestamp
pg_catalog svcs_s3query external_table_name text
pg_catalog svcs_s3query file_format char(16)
pg_catalog svcs_s3query files int4
pg_catalog svcs_s3query is_nested char(1)
pg_catalog svcs_s3query is_partitioned char(1)
pg_catalog svcs_s3query is_rrscan char(1)
pg_catalog svcs_s3query max_concurrent_slowdown_count int4
pg_catalog svcs_s3query max_request_duration int8
pg_catalog svcs_s3query max_request_parallelism int4
pg_catalog svcs_s3query max_retries int4
pg_catalog svcs_s3query max_split_size int8
pg_catalog svcs_s3query node int4
pg_catalog svcs_s3query query int4
pg_catalog svcs_s3query s3query_returned_bytes int8
pg_catalog svcs_s3query s3query_returned_rows int8
pg_catalog svcs_s3query s3_scanned_bytes int8
pg_catalog svcs_s3query s3_scanned_rows int8
pg_catalog svcs_s3query scan_type int4
pg_catalog svcs_s3query segment int4
pg_catalog svcs_s3query slice int4
pg_catalog svcs_s3query slowdown_count int4
pg_catalog svcs_s3query splits int4
pg_catalog svcs_s3query starttime timestamp
pg_catalog svcs_s3query step int4
pg_catalog svcs_s3query total_retries int4
pg_catalog svcs_s3query total_split_size int8
pg_catalog svcs_s3query userid int4

View Text

SELECT stcs.userid,
       map.primary_query AS query,
       stcs.segment,
       stcs.step,
       stcs.node,
       stcs.slice,
       CAST('1970-01-01 00:00:00' AS timestamp) + (CAST((CAST(stcs.starttime AS numeric) / (1000.0 * 1000.0)) + 946684800.0 AS double precision) * CAST('00:00:01' AS interval)) AS starttime,
       CAST('1970-01-01 00:00:00' AS timestamp) + (CAST((CAST(stcs.endtime AS numeric) / (1000.0 * 1000.0)) + 946684800.0 AS double precision) * CAST('00:00:01' AS interval)) AS endtime,
       stcs.endtime - stcs.starttime AS elapsed,
       btrim(CAST(stcs.external_table_name AS text)) AS external_table_name,
       stcs.file_format,
       stcs.is_partitioned,
       stcs.is_rrscan,
       stcs.is_nested,
       stcs.s3_scanned_rows,
       stcs.s3_scanned_bytes,
       stcs.s3query_returned_rows,
       stcs.s3query_returned_bytes,
       stcs.files,
       stcs.splits,
       stcs.total_split_size,
       stcs.max_split_size,
       stcs.total_retries,
       stcs.max_retries,
       stcs.max_request_duration,
       stcs.avg_request_duration,
       stcs.max_request_parallelism,
       stcs.avg_request_parallelism,
       stcs.slowdown_count,
       stcs.max_concurrent_slowdown_count,
       stcs.scan_type
FROM stcs_s3query AS stcs
     INNER JOIN stcs_concurrency_scaling_query_mapping AS map ON map.concurrency_scaling_query = stcs.query
WHERE stcs.__cluster_type = CAST('cs' AS bpchar)
  AND to_date(CAST(stcs.__log_generated_date AS text),
              CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval))
  AND to_date(CAST(map.__log_generated_date AS text),
              CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval))
  AND CAST(map.concurrency_scaling_cluster AS text) = split_part(CAST(stcs.__path AS text),
                                                                 CAST('/' AS text),
                                                                 10)
  AND stcs.is_copy = 0
  AND (EXISTS (SELECT 1
               FROM pg_user
               WHERE pg_user.usename = CAST("current_user"() AS name)
                 AND pg_user.usesuper = TRUE)
    OR EXISTS (SELECT 1
               FROM pg_shadow_extended
               WHERE pg_shadow_extended.sysid = current_user_id()
                 AND pg_shadow_extended.colnum = 2
                 AND pg_shadow_extended.value = CAST(-1 AS text))
    OR stcs.userid = current_user_id())


Home 3D Друк Blog Bring-Up Times Consultancy Cross-Region Benchmarks Email Forums IRC Mailing Lists Reddit Redshift Price Tracker Redshift Version Tracker Redshift Workbench System Table Tracker The Known Universe Twitter White Papers