Redshift Research Project

System Table Tracker

System view pg_catalog.svcs_unload_log version 1.0.59117 / 2023-11-08

schema name column data type
pg_catalog svcs_unload_log end_time timestamp
pg_catalog svcs_unload_log file_format char(10)
pg_catalog svcs_unload_log line_count int8
pg_catalog svcs_unload_log path char(1280)
pg_catalog svcs_unload_log pid int4
pg_catalog svcs_unload_log query int4
pg_catalog svcs_unload_log start_time timestamp
pg_catalog svcs_unload_log transfer_size int8
pg_catalog svcs_unload_log userid int4

View Text

SELECT derived_table17.userid,
       derived_table17.query,
       derived_table17.pid,
       derived_table17.path,
       min(derived_table17.start_time) AS start_time,
       max(derived_table17.end_time) AS end_time,
       sum(derived_table17.line_count) AS line_count,
       sum(derived_table17.transfer_size) AS transfer_size,
       derived_table17.file_format
FROM (SELECT svcs.userid,
             svcs.query,
             svcs.pid,
             svcs.path,
             svcs.start_time,
             svcs.end_time,
             svcs.line_count,
             svcs.transfer_size,
             svcs.file_format
      FROM (SELECT stcs.userid,
                   map.primary_query AS query,
                   stcs.pid,
                   stcs.path,
                   CAST('1970-01-01 00:00:00' AS timestamp) + (CAST((CAST(stcs.start_time AS numeric) / (1000.0 * 1000.0)) + 946684800.0 AS double precision) * CAST('00:00:01' AS interval)) AS start_time,
                   CAST('1970-01-01 00:00:00' AS timestamp) + (CAST((CAST(stcs.end_time AS numeric) / (1000.0 * 1000.0)) + 946684800.0 AS double precision) * CAST('00:00:01' AS interval)) AS end_time,
                   stcs.line_count,
                   stcs.transfer_size,
                   stcs.file_format
            FROM stcs_unload_log 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 (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())) AS svcs

      UNION ALL

      SELECT stl_unload_log.userid,
             stl_unload_log.query,
             stl_unload_log.pid,
             stl_unload_log.path,
             stl_unload_log.start_time,
             stl_unload_log.end_time,
             stl_unload_log.line_count,
             stl_unload_log.transfer_size,
             stl_unload_log.file_format
      FROM stl_unload_log) AS derived_table17
GROUP BY derived_table17.userid, derived_table17.query, derived_table17.pid, derived_table17.path, derived_table17.file_format


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