Redshift Research Project

System Table Tracker

System view pg_catalog.svcs_plan_info version 1.0.61395 / 2023-12-30

schema name column data type
pg_catalog svcs_plan_info bytes int8
pg_catalog svcs_plan_info locus int4
pg_catalog svcs_plan_info nodeid int4
pg_catalog svcs_plan_info plannode int4
pg_catalog svcs_plan_info query int4
pg_catalog svcs_plan_info rows int8
pg_catalog svcs_plan_info segment int4
pg_catalog svcs_plan_info startupcost float8
pg_catalog svcs_plan_info step int4
pg_catalog svcs_plan_info totalcost float8
pg_catalog svcs_plan_info userid int4

View Text

SELECT stcs.userid,
       map.primary_query AS query,
       stcs.nodeid,
       stcs.segment,
       stcs.step,
       stcs.locus,
       stcs.plannode,
       stcs.startupcost,
       stcs.totalcost,
       stcs.rows,
       stcs.bytes
FROM stcs_plan_info 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())

UNION ALL

SELECT stl_plan_info.userid,
       stl_plan_info.query,
       stl_plan_info.nodeid,
       stl_plan_info.segment,
       stl_plan_info.step,
       stl_plan_info.locus,
       stl_plan_info.plannode,
       stl_plan_info.startupcost,
       stl_plan_info.totalcost,
       stl_plan_info.rows,
       stl_plan_info.bytes
FROM stl_plan_info


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