FAIRYFAR-INTERNAL
 
  FAIRYFAR-INTERNAL  |  SITEMAP  |  ABOUT-ME  |  HOME  
为Greenplum添加常用视图

查询资源队列配置视图

为GPDB添加查询资源队列配置的视图:

snippet.sql
-- ------------------------------------------------------------------------------
-- @view:
--              gp_toolkit.gp_resqueue_config
--
-- @doc:
--              Resource queue configuration
--
-- ------------------------------------------------------------------------------
 
CREATE VIEW gp_toolkit.gp_resqueue_config
AS
    SELECT
        Q.oid                   AS queueoid
        , Q.rsqname             AS queuename
        , Q.rsqcountlimit       AS active_statements
        , Q.rsqcostlimit        AS max_cost
        , Q.rsqignorecostlimit  AS min_cost
        , Q.rsqovercommit       AS cost_overcommit
        , T1.ressetting         AS priority
        , T2.ressetting         AS memory_limit
    FROM
        pg_resqueue Q
        LEFT JOIN pg_resqueuecapability T1 ON Q.oid = T1.resqueueid AND T1.restypid = 5
        LEFT JOIN pg_resqueuecapability T2 ON Q.oid = T2.resqueueid AND T2.restypid = 6
    ;
 
GRANT SELECT ON gp_toolkit.gp_resqueue_config TO public;

资源组与角色之间指派关系视图

snippet.sql
-- ------------------------------------------------------------------------------
-- @view:
--        gp_toolkit.gp_resgroup_role
--
-- @doc:
--        Assigned resource group to roles
--
-- ------------------------------------------------------------------------------
 
CREATE VIEW gp_toolkit.gp_resgroup_role
AS
    SELECT
        pgr.rolname AS rrrolname,
		pgrg.rsgname AS rrrsgname
	FROM
		pg_catalog.pg_roles pgr
	JOIN
		pg_catalog.pg_resgroup pgrg
	ON
		pgr.rolresgroup = pgrg.oid
	;
 
GRANT SELECT ON gp_toolkit.gp_resgroup_role TO public;


打赏作者以资鼓励:
移动端扫码阅读: