This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a script to check the list of running queries or statements which are waiting in the Resource Queues of Greenplum.
The Workload management of Greenplum means – Set priorities of database user’s queries using Resource Queues. If you create RQ with the limit of 10 concurrent queries and user is trying to execute more than 10 queries at a time then few RQ keeps few queries in the waiting mode.
Using below query, you can get the list of running queries which are in the waiting mode.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
SELECT rolname ,rsqname ,pid ,granted ,current_query ,datname FROM pg_roles, gp_toolkit.gp_resqueue_status ,pg_locks, pg_stat_activity WHERE pg_roles.rolresqueue=pg_locks.objid AND pg_locks.objid=gp_toolkit.gp_resqueue_status.queueid AND pg_stat_activity.procpid=pg_locks.pid AND pg_stat_activity.usename=pg_roles.rolnam |
Leave a Reply