Redshift Observatory

System Table Tracker

System view pg_catalog.svcs_query_report version 1.0.46607 / 2023-02-12

schema name column data type
pg_catalog svcs_query_report bytes int8
pg_catalog svcs_query_report elapsed_time int8
pg_catalog svcs_query_report end_time timestamp
pg_catalog svcs_query_report is_delayed_scan char(1)
pg_catalog svcs_query_report is_diskbased char(1)
pg_catalog svcs_query_report is_rrscan char(1)
pg_catalog svcs_query_report label varchar(164)
pg_catalog svcs_query_report query int4
pg_catalog svcs_query_report rows int8
pg_catalog svcs_query_report rows_pre_filter int8
pg_catalog svcs_query_report segment int4
pg_catalog svcs_query_report slice int4
pg_catalog svcs_query_report start_time timestamp
pg_catalog svcs_query_report step int4
pg_catalog svcs_query_report userid int4
pg_catalog svcs_query_report workmem int8

View Text

SELECT stcs.userid,
       map.primary_query AS query,
       stcs.slice,
       stcs.segment,
       stcs.step,
       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.elapsed_time,
       stcs.rows,
       stcs.bytes,
       stcs.label,
       stcs.is_diskbased,
       stcs.workmem,
       stcs.is_rrscan,
       stcs.is_delayed_scan,
       stcs.rows_pre_filter
FROM ((((((((((((((((((SELECT stcs_aggr.userid,
                              stcs_aggr.query,
                              stcs_aggr.slice,
                              stcs_aggr.segment,
                              stcs_aggr.step,
                              stcs_aggr.starttime AS start_time,
                              stcs_aggr.endtime AS end_time,
                              stcs_aggr.endtime - stcs_aggr.starttime AS elapsed_time,
                              stcs_aggr.rows,
                              stcs_aggr.bytes,
                              CAST(CAST('aggr   tbl=' AS text) || CAST(stcs_aggr.tbl AS text) AS varchar) AS label,
                              stcs_aggr.is_diskbased,
                              stcs_aggr.workmem,
                              CAST('f' AS bpchar) AS is_rrscan,
                              CAST('f' AS bpchar) AS is_delayed_scan,
                              0 AS rows_pre_filter,
                              CAST(split_part(CAST(stcs_aggr.__path AS text),
                                              CAST('/' AS text),
                                              10) AS varchar) AS burst_cluster
                       FROM stcs_aggr
                       WHERE stcs_aggr.__cluster_type = CAST('cs' AS bpchar)
                         AND to_date(CAST(stcs_aggr.__log_generated_date AS text),
                                     CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval))

                       UNION ALL

                       SELECT stcs_bcast.userid,
                              stcs_bcast.query,
                              stcs_bcast.slice,
                              stcs_bcast.segment,
                              stcs_bcast.step,
                              stcs_bcast.starttime AS start_time,
                              stcs_bcast.endtime AS end_time,
                              stcs_bcast.endtime - stcs_bcast.starttime AS elapsed_time,
                              stcs_bcast.rows,
                              stcs_bcast.bytes,
                              CAST('bcast               ' AS varchar) AS label,
                              CAST('f' AS bpchar) AS is_diskbased,
                              0 AS workmem,
                              CAST('f' AS bpchar) AS is_rrscan,
                              CAST('f' AS bpchar) AS is_delayed_scan,
                              0 AS rows_pre_filter,
                              CAST(split_part(CAST(stcs_bcast.__path AS text),
                                              CAST('/' AS text),
                                              10) AS varchar) AS burst_cluster
                       FROM stcs_bcast
                       WHERE stcs_bcast.__cluster_type = CAST('cs' AS bpchar)
                         AND to_date(CAST(stcs_bcast.__log_generated_date AS text),
                                     CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                      UNION ALL

                      SELECT stcs_delete.userid,
                             stcs_delete.query,
                             stcs_delete.slice,
                             stcs_delete.segment,
                             stcs_delete.step,
                             stcs_delete.starttime AS start_time,
                             stcs_delete.endtime AS end_time,
                             stcs_delete.endtime - stcs_delete.starttime AS elapsed_time,
                             stcs_delete.rows,
                             0 AS bytes,
                             CAST(CAST('delete tbl=' AS text) || CAST(stcs_delete.tbl AS text) AS varchar) AS label,
                             CAST('f' AS bpchar) AS is_diskbased,
                             0 AS workmem,
                             CAST('f' AS bpchar) AS is_rrscan,
                             CAST('f' AS bpchar) AS is_delayed_scan,
                             0 AS rows_pre_filter,
                             CAST(split_part(CAST(stcs_delete.__path AS text),
                                             CAST('/' AS text),
                                             10) AS varchar) AS burst_cluster
                      FROM stcs_delete
                      WHERE stcs_delete.__cluster_type = CAST('cs' AS bpchar)
                        AND to_date(CAST(stcs_delete.__log_generated_date AS text),
                                    CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                     UNION ALL

                     SELECT stcs_dist.userid,
                            stcs_dist.query,
                            stcs_dist.slice,
                            stcs_dist.segment,
                            stcs_dist.step,
                            stcs_dist.starttime AS start_time,
                            stcs_dist.endtime AS end_time,
                            stcs_dist.endtime - stcs_dist.starttime AS elapsed_time,
                            stcs_dist.rows,
                            stcs_dist.bytes,
                            CAST('dist                ' AS varchar) AS label,
                            CAST('f' AS bpchar) AS is_diskbased,
                            0 AS workmem,
                            CAST('f' AS bpchar) AS is_rrscan,
                            CAST('f' AS bpchar) AS is_delayed_scan,
                            0 AS rows_pre_filter,
                            CAST(split_part(CAST(stcs_dist.__path AS text),
                                            CAST('/' AS text),
                                            10) AS varchar) AS burst_cluster
                     FROM stcs_dist
                     WHERE stcs_dist.__cluster_type = CAST('cs' AS bpchar)
                       AND to_date(CAST(stcs_dist.__log_generated_date AS text),
                                   CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                    UNION ALL

                    SELECT stcs_hash.userid,
                           stcs_hash.query,
                           stcs_hash.slice,
                           stcs_hash.segment,
                           stcs_hash.step,
                           stcs_hash.starttime AS start_time,
                           stcs_hash.endtime AS end_time,
                           stcs_hash.endtime - stcs_hash.starttime AS elapsed_time,
                           stcs_hash.rows,
                           stcs_hash.bytes,
                           CAST(CAST('hash   tbl=' AS text) || CAST(stcs_hash.tbl AS text) AS varchar) AS label,
                           stcs_hash.is_diskbased,
                           stcs_hash.workmem,
                           CAST('f' AS bpchar) AS is_rrscan,
                           CAST('f' AS bpchar) AS is_delayed_scan,
                           0 AS rows_pre_filter,
                           CAST(split_part(CAST(stcs_hash.__path AS text),
                                           CAST('/' AS text),
                                           10) AS varchar) AS burst_cluster
                    FROM stcs_hash
                    WHERE stcs_hash.__cluster_type = CAST('cs' AS bpchar)
                      AND to_date(CAST(stcs_hash.__log_generated_date AS text),
                                  CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                   UNION ALL

                   SELECT stcs_hashjoin.userid,
                          stcs_hashjoin.query,
                          stcs_hashjoin.slice,
                          stcs_hashjoin.segment,
                          stcs_hashjoin.step,
                          stcs_hashjoin.starttime AS start_time,
                          stcs_hashjoin.endtime AS end_time,
                          stcs_hashjoin.endtime - stcs_hashjoin.starttime AS elapsed_time,
                          stcs_hashjoin.rows,
                          0 AS bytes,
                          CAST(CAST('hjoin  tbl=' AS text) || CAST(stcs_hashjoin.tbl AS text) AS varchar) AS label,
                          CAST('f' AS bpchar) AS is_diskbased,
                          0 AS workmem,
                          CAST('f' AS bpchar) AS is_rrscan,
                          CAST('f' AS bpchar) AS is_delayed_scan,
                          0 AS rows_pre_filter,
                          CAST(split_part(CAST(stcs_hashjoin.__path AS text),
                                          CAST('/' AS text),
                                          10) AS varchar) AS burst_cluster
                   FROM stcs_hashjoin
                   WHERE stcs_hashjoin.__cluster_type = CAST('cs' AS bpchar)
                     AND to_date(CAST(stcs_hashjoin.__log_generated_date AS text),
                                 CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                  UNION ALL

                  SELECT stcs_insert.userid,
                         stcs_insert.query,
                         stcs_insert.slice,
                         stcs_insert.segment,
                         stcs_insert.step,
                         stcs_insert.starttime AS start_time,
                         stcs_insert.endtime AS end_time,
                         stcs_insert.endtime - stcs_insert.starttime AS elapsed_time,
                         stcs_insert.rows,
                         0 AS bytes,
                         CAST(CAST('insert tbl=' AS text) || CAST(stcs_insert.tbl AS text) AS varchar) AS label,
                         CAST('f' AS bpchar) AS is_diskbased,
                         0 AS workmem,
                         CAST('f' AS bpchar) AS is_rrscan,
                         CAST('f' AS bpchar) AS is_delayed_scan,
                         0 AS rows_pre_filter,
                         CAST(split_part(CAST(stcs_insert.__path AS text),
                                         CAST('/' AS text),
                                         10) AS varchar) AS burst_cluster
                  FROM stcs_insert
                  WHERE stcs_insert.__cluster_type = CAST('cs' AS bpchar)
                    AND to_date(CAST(stcs_insert.__log_generated_date AS text),
                                CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                 UNION ALL

                 SELECT stcs_limit.userid,
                        stcs_limit.query,
                        stcs_limit.slice,
                        stcs_limit.segment,
                        stcs_limit.step,
                        stcs_limit.starttime AS start_time,
                        stcs_limit.endtime AS end_time,
                        stcs_limit.endtime - stcs_limit.starttime AS elapsed_time,
                        stcs_limit.rows,
                        0 AS bytes,
                        CAST('limit               ' AS varchar) AS label,
                        CAST('f' AS bpchar) AS is_diskbased,
                        0 AS workmem,
                        CAST('f' AS bpchar) AS is_rrscan,
                        CAST('f' AS bpchar) AS is_delayed_scan,
                        0 AS rows_pre_filter,
                        CAST(split_part(CAST(stcs_limit.__path AS text),
                                        CAST('/' AS text),
                                        10) AS varchar) AS burst_cluster
                 FROM stcs_limit
                 WHERE stcs_limit.__cluster_type = CAST('cs' AS bpchar)
                   AND to_date(CAST(stcs_limit.__log_generated_date AS text),
                               CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

                UNION ALL

                SELECT stcs_merge.userid,
                       stcs_merge.query,
                       stcs_merge.slice,
                       stcs_merge.segment,
                       stcs_merge.step,
                       stcs_merge.starttime AS start_time,
                       stcs_merge.endtime AS end_time,
                       stcs_merge.endtime - stcs_merge.starttime AS elapsed_time,
                       stcs_merge.rows,
                       0 AS bytes,
                       CAST('merge               ' AS varchar) AS label,
                       CAST('f' AS bpchar) AS is_diskbased,
                       0 AS workmem,
                       CAST('f' AS bpchar) AS is_rrscan,
                       CAST('f' AS bpchar) AS is_delayed_scan,
                       0 AS rows_pre_filter,
                       CAST(split_part(CAST(stcs_merge.__path AS text),
                                       CAST('/' AS text),
                                       10) AS varchar) AS burst_cluster
                FROM stcs_merge
                WHERE stcs_merge.__cluster_type = CAST('cs' AS bpchar)
                  AND to_date(CAST(stcs_merge.__log_generated_date AS text),
                              CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

               UNION ALL

               SELECT stcs_mergejoin.userid,
                      stcs_mergejoin.query,
                      stcs_mergejoin.slice,
                      stcs_mergejoin.segment,
                      stcs_mergejoin.step,
                      stcs_mergejoin.starttime AS start_time,
                      stcs_mergejoin.endtime AS end_time,
                      stcs_mergejoin.endtime - stcs_mergejoin.starttime AS elapsed_time,
                      stcs_mergejoin.rows,
                      0 AS bytes,
                      CAST(CAST('mjoin  tbl=' AS text) || CAST(stcs_mergejoin.tbl AS text) AS varchar) AS label,
                      CAST('f' AS bpchar) AS is_diskbased,
                      0 AS workmem,
                      CAST('f' AS bpchar) AS is_rrscan,
                      CAST('f' AS bpchar) AS is_delayed_scan,
                      0 AS rows_pre_filter,
                      CAST(split_part(CAST(stcs_mergejoin.__path AS text),
                                      CAST('/' AS text),
                                      10) AS varchar) AS burst_cluster
               FROM stcs_mergejoin
               WHERE stcs_mergejoin.__cluster_type = CAST('cs' AS bpchar)
                 AND to_date(CAST(stcs_mergejoin.__log_generated_date AS text),
                             CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

              UNION ALL

              SELECT stcs_nestloop.userid,
                     stcs_nestloop.query,
                     stcs_nestloop.slice,
                     stcs_nestloop.segment,
                     stcs_nestloop.step,
                     stcs_nestloop.starttime AS start_time,
                     stcs_nestloop.endtime AS end_time,
                     stcs_nestloop.endtime - stcs_nestloop.starttime AS elapsed_time,
                     stcs_nestloop.rows,
                     0 AS bytes,
                     CAST(CAST('nloop  tbl=' AS text) || CAST(stcs_nestloop.tbl AS text) AS varchar) AS label,
                     CAST('f' AS bpchar) AS is_diskbased,
                     0 AS workmem,
                     CAST('f' AS bpchar) AS is_rrscan,
                     CAST('f' AS bpchar) AS is_delayed_scan,
                     0 AS rows_pre_filter,
                     CAST(split_part(CAST(stcs_nestloop.__path AS text),
                                     CAST('/' AS text),
                                     10) AS varchar) AS burst_cluster
              FROM stcs_nestloop
              WHERE stcs_nestloop.__cluster_type = CAST('cs' AS bpchar)
                AND to_date(CAST(stcs_nestloop.__log_generated_date AS text),
                            CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

             UNION ALL

             SELECT stcs_parse.userid,
                    stcs_parse.query,
                    stcs_parse.slice,
                    stcs_parse.segment,
                    stcs_parse.step,
                    stcs_parse.starttime AS start_time,
                    stcs_parse.endtime AS end_time,
                    stcs_parse.endtime - stcs_parse.starttime AS elapsed_time,
                    stcs_parse.rows,
                    0 AS bytes,
                    CAST('parse               ' AS varchar) AS label,
                    CAST('f' AS bpchar) AS is_diskbased,
                    0 AS workmem,
                    CAST('f' AS bpchar) AS is_rrscan,
                    CAST('f' AS bpchar) AS is_delayed_scan,
                    0 AS rows_pre_filter,
                    CAST(split_part(CAST(stcs_parse.__path AS text),
                                    CAST('/' AS text),
                                    10) AS varchar) AS burst_cluster
             FROM stcs_parse
             WHERE stcs_parse.__cluster_type = CAST('cs' AS bpchar)
               AND to_date(CAST(stcs_parse.__log_generated_date AS text),
                           CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

            UNION ALL

            SELECT stcs_scan.userid,
                   stcs_scan.query,
                   stcs_scan.slice,
                   stcs_scan.segment,
                   stcs_scan.step,
                   stcs_scan.starttime AS start_time,
                   stcs_scan.endtime AS end_time,
                   stcs_scan.endtime - stcs_scan.starttime AS elapsed_time,
                   stcs_scan.rows,
                   stcs_scan.bytes,
                   CAST(CASE
                          WHEN stcs_scan.type = 19
                            THEN CAST('scan   udf=' AS text) || CAST(stcs_scan.tbl AS text)
                          ELSE ((CAST('scan   tbl=' AS text) || CAST(stcs_scan.tbl AS text)) || CAST(' name=' AS text)) || CAST(stcs_scan.perm_table_name AS text)
                        END AS varchar) AS label,
                   CAST('f' AS bpchar) AS is_diskbased,
                   0 AS workmem,
                   stcs_scan.is_rrscan,
                   stcs_scan.is_delayed_scan,
                   stcs_scan.rows_pre_filter,
                   CAST(split_part(CAST(stcs_scan.__path AS text),
                                   CAST('/' AS text),
                                   10) AS varchar) AS burst_cluster
            FROM stcs_scan
            WHERE stcs_scan.__cluster_type = CAST('cs' AS bpchar)
              AND to_date(CAST(stcs_scan.__log_generated_date AS text),
                          CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

           UNION ALL

           SELECT stcs_project.userid,
                  stcs_project.query,
                  stcs_project.slice,
                  stcs_project.segment,
                  stcs_project.step,
                  stcs_project.starttime AS start_time,
                  stcs_project.endtime AS end_time,
                  stcs_project.endtime - stcs_project.starttime AS elapsed_time,
                  stcs_project.rows,
                  0 AS bytes,
                  CAST('project             ' AS varchar) AS label,
                  CAST('f' AS bpchar) AS is_diskbased,
                  0 AS workmem,
                  CAST('f' AS bpchar) AS is_rrscan,
                  CAST('f' AS bpchar) AS is_delayed_scan,
                  0 AS rows_pre_filter,
                  CAST(split_part(CAST(stcs_project.__path AS text),
                                  CAST('/' AS text),
                                  10) AS varchar) AS burst_cluster
           FROM stcs_project
           WHERE stcs_project.__cluster_type = CAST('cs' AS bpchar)
             AND to_date(CAST(stcs_project.__log_generated_date AS text),
                         CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

          UNION ALL

          SELECT stcs_return.userid,
                 stcs_return.query,
                 stcs_return.slice,
                 stcs_return.segment,
                 stcs_return.step,
                 stcs_return.starttime AS start_time,
                 stcs_return.endtime AS end_time,
                 stcs_return.endtime - stcs_return.starttime AS elapsed_time,
                 stcs_return.rows,
                 stcs_return.bytes,
                 CAST('return              ' AS varchar) AS label,
                 CAST('f' AS bpchar) AS is_diskbased,
                 0 AS workmem,
                 CAST('f' AS bpchar) AS is_rrscan,
                 CAST('f' AS bpchar) AS is_delayed_scan,
                 0 AS rows_pre_filter,
                 CAST(split_part(CAST(stcs_return.__path AS text),
                                 CAST('/' AS text),
                                 10) AS varchar) AS burst_cluster
          FROM stcs_return
          WHERE stcs_return.__cluster_type = CAST('cs' AS bpchar)
            AND to_date(CAST(stcs_return.__log_generated_date AS text),
                        CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

         UNION ALL

         SELECT stcs_save.userid,
                stcs_save.query,
                stcs_save.slice,
                stcs_save.segment,
                stcs_save.step,
                stcs_save.starttime AS start_time,
                stcs_save.endtime AS end_time,
                stcs_save.endtime - stcs_save.starttime AS elapsed_time,
                stcs_save.rows,
                stcs_save.bytes,
                CAST(CAST('save   tbl=' AS text) || CAST(stcs_save.tbl AS text) AS varchar) AS label,
                stcs_save.is_diskbased,
                stcs_save.workmem,
                CAST('f' AS bpchar) AS is_rrscan,
                CAST('f' AS bpchar) AS is_delayed_scan,
                0 AS rows_pre_filter,
                CAST(split_part(CAST(stcs_save.__path AS text),
                                CAST('/' AS text),
                                10) AS varchar) AS burst_cluster
         FROM stcs_save
         WHERE stcs_save.__cluster_type = CAST('cs' AS bpchar)
           AND to_date(CAST(stcs_save.__log_generated_date AS text),
                       CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

        UNION ALL

        SELECT stcs_sort.userid,
               stcs_sort.query,
               stcs_sort.slice,
               stcs_sort.segment,
               stcs_sort.step,
               stcs_sort.starttime AS start_time,
               stcs_sort.endtime AS end_time,
               stcs_sort.endtime - stcs_sort.starttime AS elapsed_time,
               stcs_sort.rows,
               stcs_sort.bytes,
               CAST(CAST('sort   tbl=' AS text) || CAST(stcs_sort.tbl AS text) AS varchar) AS label,
               stcs_sort.is_diskbased,
               stcs_sort.workmem,
               CAST('f' AS bpchar) AS is_rrscan,
               CAST('f' AS bpchar) AS is_delayed_scan,
               0 AS rows_pre_filter,
               CAST(split_part(CAST(stcs_sort.__path AS text),
                               CAST('/' AS text),
                               10) AS varchar) AS burst_cluster
        FROM stcs_sort
        WHERE stcs_sort.__cluster_type = CAST('cs' AS bpchar)
          AND to_date(CAST(stcs_sort.__log_generated_date AS text),
                      CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

       UNION ALL

       SELECT stcs_unique.userid,
              stcs_unique.query,
              stcs_unique.slice,
              stcs_unique.segment,
              stcs_unique.step,
              stcs_unique.starttime AS start_time,
              stcs_unique.endtime AS end_time,
              stcs_unique.endtime - stcs_unique.starttime AS elapsed_time,
              stcs_unique.rows,
              0 AS bytes,
              CAST('unique              ' AS varchar) AS label,
              stcs_unique.is_diskbased,
              stcs_unique.workmem,
              CAST('f' AS bpchar) AS is_rrscan,
              CAST('f' AS bpchar) AS is_delayed_scan,
              0 AS rows_pre_filter,
              CAST(split_part(CAST(stcs_unique.__path AS text),
                              CAST('/' AS text),
                              10) AS varchar) AS burst_cluster
       FROM stcs_unique
       WHERE stcs_unique.__cluster_type = CAST('cs' AS bpchar)
         AND to_date(CAST(stcs_unique.__log_generated_date AS text),
                     CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval)))

      UNION ALL

      SELECT stcs_window.userid,
             stcs_window.query,
             stcs_window.slice,
             stcs_window.segment,
             stcs_window.step,
             stcs_window.starttime AS start_time,
             stcs_window.endtime AS end_time,
             stcs_window.endtime - stcs_window.starttime AS elapsed_time,
             stcs_window.rows,
             0 AS bytes,
             CAST('window              ' AS varchar) AS label,
             stcs_window.is_diskbased,
             stcs_window.workmem,
             CAST('f' AS bpchar) AS is_rrscan,
             CAST('f' AS bpchar) AS is_delayed_scan,
             0 AS rows_pre_filter,
             CAST(split_part(CAST(stcs_window.__path AS text),
                             CAST('/' AS text),
                             10) AS varchar) AS burst_cluster
      FROM stcs_window
      WHERE stcs_window.__cluster_type = CAST('cs' AS bpchar)
        AND to_date(CAST(stcs_window.__log_generated_date AS text),
                    CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval))) AS stcs
     INNER JOIN stcs_concurrency_scaling_query_mapping AS map ON map.concurrency_scaling_query = stcs.query
WHERE to_date(CAST(map.__log_generated_date AS text),
              CAST('YYYYMMDD' AS text)) > (getdate() - CAST('7 days' AS interval))
  AND map.concurrency_scaling_cluster = CAST(stcs.burst_cluster AS bpchar)
  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