Redshift Observatory

System Table Tracker

System view pg_catalog.svcs_concurrency_scaling_usage version 1.0.74503 / 2024-09-16

schema name column data type
pg_catalog svcs_concurrency_scaling_usage end_time timestamp
pg_catalog svcs_concurrency_scaling_usage queries int8
pg_catalog svcs_concurrency_scaling_usage start_time timestamp
pg_catalog svcs_concurrency_scaling_usage usage_in_seconds numeric(23,0)

View Text

SELECT f.starttime AS start_time,
       f.endtime AS end_time,
       count(DISTINCT qcnt.query) AS queries,
       ceil(CAST(date_diff(CAST('ms' AS text),
                           f.starttime,
                           f.endtime) AS numeric) / 1000.000) AS usage_in_seconds
FROM (SELECT s.cluster,
             s.starttime,
             min(e.endtime) AS endtime
      FROM (SELECT start1.cluster,
                   start1.query,
                   start1.starttime,
                   start1.endtime
            FROM (SELECT stl_concurrency_scaling_usage.cluster,
                         stl_concurrency_scaling_usage.query,
                         stl_concurrency_scaling_usage.starttime,
                         stl_concurrency_scaling_usage.endtime
                  FROM stl_concurrency_scaling_usage) AS start1
                 LEFT JOIN (SELECT stl_concurrency_scaling_usage.cluster,
                                   stl_concurrency_scaling_usage.query,
                                   stl_concurrency_scaling_usage.starttime,
                                   stl_concurrency_scaling_usage.endtime
                            FROM stl_concurrency_scaling_usage) AS start2 ON start1.cluster = start2.cluster
                                                                         AND start1.starttime > start2.starttime
                                                                         AND start1.starttime <= start2.endtime
            WHERE start2.cluster IS NULL) AS s
           INNER JOIN (SELECT end1.cluster,
                              end1.query,
                              end1.starttime,
                              end1.endtime
                       FROM (SELECT stl_concurrency_scaling_usage.cluster,
                                    stl_concurrency_scaling_usage.query,
                                    stl_concurrency_scaling_usage.starttime,
                                    stl_concurrency_scaling_usage.endtime
                             FROM stl_concurrency_scaling_usage) AS end1
                            LEFT JOIN (SELECT stl_concurrency_scaling_usage.cluster,
                                              stl_concurrency_scaling_usage.query,
                                              stl_concurrency_scaling_usage.starttime,
                                              stl_concurrency_scaling_usage.endtime
                                       FROM stl_concurrency_scaling_usage) AS end2 ON end1.cluster = end2.cluster
                                                                                  AND end1.endtime >= end2.starttime
                                                                                  AND end1.endtime < end2.endtime
                       WHERE end2.cluster IS NULL) AS e ON s.cluster = e.cluster
                                                       AND s.starttime <= e.endtime
      GROUP BY s.cluster, s.starttime) AS f
     INNER JOIN (SELECT stl_concurrency_scaling_usage.cluster,
                        stl_concurrency_scaling_usage.query,
                        stl_concurrency_scaling_usage.starttime,
                        stl_concurrency_scaling_usage.endtime
                 FROM stl_concurrency_scaling_usage) AS qcnt ON f.cluster = qcnt.cluster
                                                            AND f.starttime <= qcnt.starttime
                                                            AND f.endtime >= qcnt.endtime
                                                            AND qcnt.query > 0
GROUP BY f.cluster, f.starttime, f.endtime
ORDER BY f.starttime


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