Pivotal Knowledge Base

Follow

HowTo - View data distribution across segment servers

Problem

How to view data distribution across segment servers.

Solution

To view the data distribution of a tables 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 tables 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;

To redistribute the data for a table you can refer the to article

Comments

Powered by Zendesk