GP - report the segment host configuration

SQL to list out segment host configuration

SELECT hostname AS \"Host\",
sum(CASE WHEN role='p' AND content >= 0 THEN 1 ELSE 0 END) AS \"# of Primary Segs\",
sum(CASE WHEN role='m' AND content >= 0 THEN 1 ELSE 0 END) AS \"# of Mirror Segs\",
sum(CASE WHEN role=preferred_role THEN 1 ELSE 0 END) AS \"# in Preferred Role\"
FROM gp_segment_configuration
GROUP BY rollup(1);

Comments

Popular posts from this blog

How to set Optimizer at database level in greenplum

Changing the gpmon Password

IPMI Tool | IPMI Cheatsheet