pg_stat_resqueues
Post date: Oct 12, 2014 3:5:58 AM
The pg_stat_resqueues view allows administrators to view metrics about a resource queue's workload over time. To allow statistics to be collected for this view, you must enable the stats_queue_level server configuration parameter on the Greenplum Database master instance. Enabling the collection of these metrics does incur a small performance penalty, as each statement submitted through a resource queue must be logged in the system catalog tables.
sachi=# select * from pg_catalog.pg_stat_resqueues;
queueid | queuename | n_queries_exec | n_queries_wait | elapsed_exec | elapsed_wait
---------+------------+----------------+----------------+--------------+--------------
16995 | perf_test | 0 | 0 | 0 | 0
6055 | pg_default | 0 | 0 | 0 | 0
33478 | myque1 | 0 | 0 | 0 | 0
33481 | myque2 | 0 | 0 | 0 | 0
33484 | myque3 | 0 | 0 | 0 | 0
52269 | highrq | 0 | 0 | 0 | 0
52275 | cdr_test | 0 | 0 | 0 | 0
(7 rows)
sachi=#
gp_resqueue_status
The gp_toolkit.gp_resqueue_status view allows administrators to see status and activity for a workload management resource queue. It shows how many queries are waiting to run and how many queries are currently active in the system from a particular resource queue.
sachi=# select * from gp_toolkit.gp_resqueue_status;
queueid | rsqname | rsqcountlimit | rsqcountvalue | rsqcostlimit | rsqcostvalue | rsqmemorylimit | rsqmemoryvalue | rsqwaiters | rsqholders
---------+------------+---------------+---------------+--------------+--------------+----------------+----------------+------------+------------
16995 | perf_test | 2 | 0 | 1e+08 | 0 | -1 | 0 | 0 | 0
33484 | myque3 | -1 | 0 | 1e+08 | 0 | -1 | 0 | 0 | 0
52275 | cdr_test | 25 | 0 | -1 | 0 | -1 | 0 | 0 | 0
33478 | myque1 | 20 | 0 | -1 | 0 | -1 | 0 | 0 | 0
52269 | highrq | 20 | 0 | -1 | 0 | 4.1943e+09 | 0 | 0 | 0
33481 | myque2 | 20 | 0 | 1e+08 | 0 | -1 | 0 | 0 | 0
6055 | pg_default | 20 | 0 | -1 | 0 | -1 | 0 | 0 | 0
(7 rows)