How to view Data Distribution across segment Servers?

Post date: Oct 05, 2012 2:48:24 PM

Viewing Data Distribution in v4.x

To view the data distribution of a table’s rows (the number of rows on each segment), you can run a query such as:

# SELECT gp_segment_id, count(*)

FROM table_name GROUP BY gp_segment_id;

To see the data distribution of a table’s rows on segment servers and the directory location of where the data is located, you can run a query such as:

# SELECT table_name.gp_segment_id,hostname, fselocation as datadir,count(*)

FROM table_name, pg_filespace_entry pgfse,gp_segment_configuration gsc

WHERE gsc.dbid=pgfse.fsedbid and table_name.gp_segment_id= pgfse.fsedbid

GROUP BY table_name.gp_segment_id,hostname,datadir

ORDER BY gp_segment_id;

Notes: Balanced Distribution

A table is considered to have a balanced distribution if all of the segments have roughly the same number of rows.