Redshift Observatory

System Table Tracker

System view pg_catalog.svl_query_queue_info version 1.0.41465 / 2022-09-10

schema name column data type
pg_catalog svl_query_queue_info commit_exec_time int8
pg_catalog svl_query_queue_info commit_queue_elapsed int8
pg_catalog svl_query_queue_info database text
pg_catalog svl_query_queue_info exec_elapsed int8
pg_catalog svl_query_queue_info exec_start_time timestamp
pg_catalog svl_query_queue_info query int4
pg_catalog svl_query_queue_info querytxt text
pg_catalog svl_query_queue_info queue_elapsed int8
pg_catalog svl_query_queue_info queue_start_time timestamp
pg_catalog svl_query_queue_info service_class int4
pg_catalog svl_query_queue_info service_class_name char(64)
pg_catalog svl_query_queue_info slots int4
pg_catalog svl_query_queue_info userid int4
pg_catalog svl_query_queue_info wlm_total_elapsed int8
pg_catalog svl_query_queue_info xid int8

View Text

SELECT wd.db AS database,
       wd.query,
       wd.xid,
       wd.userid,
       wd.querytxt,
       wd.queue_start_time,
       wd.exec_start_time,
       wd.service_class,
       wd.slots,
       wd.queue_seconds AS queue_elapsed,
       wd.exec_seconds AS exec_elapsed,
       wd.total_wlm_seconds AS wlm_total_elapsed,
       ct.commit_queue_time_seconds AS commit_queue_elapsed,
       ct.commit_time_seconds AS commit_exec_time,
       wd.service_class_name
FROM (SELECT swq.query,
             swq.xid,
             swq.userid,
             btrim(CAST(sq.database AS text)) AS db,
             substring(CAST(sq.querytxt AS text),
                       1,
                       100) AS querytxt,
             swq.service_class,
             swq.service_class_name,
             swq.queue_start_time,
             swq.exec_start_time,
             swq.slot_count AS slots,
             swq.total_queue_time / 1000000 AS queue_seconds,
             swq.total_exec_time / 1000000 AS exec_seconds,
             (swq.total_queue_time + swq.total_exec_time) / 1000000 AS total_wlm_seconds
      FROM stl_wlm_query AS swq
           LEFT JOIN stl_query AS sq ON swq.query = sq.query
      WHERE swq.userid > 1) AS wd
     LEFT JOIN (SELECT scs.xid,
                       max(date_diff(CAST('microsec' AS text),
                                     CASE
                                       WHEN scs.startqueue = CAST('2000-01-01 00:00:00' AS timestamp)
                                         OR (scs.startqueue IS NULL
                                         AND '2000-01-01 00:00:00' IS NULL)
                                         THEN scs.startwork
                                       ELSE scs.startqueue
                                     END,
                                     scs.startwork)) / 1000000 AS commit_queue_time_seconds,
                       max(date_diff(CAST('microsec' AS text),
                                     scs.startwork,
                                     scs.endtime)) / 1000000 AS commit_time_seconds
                FROM stl_commit_stats AS scs
                GROUP BY scs.xid) AS ct ON wd.xid = ct.xid
WHERE wd.queue_seconds > 0
   OR COALESCE(ct.commit_queue_time_seconds,
               CAST(0 AS bigint)) > 0


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