Pivotal Greenplum (GPDB) all versions
Before beginning, it is highly recommended to have a look at this article to understand what bloats are. The bloats can also be removed using a vacuum, but do look at this article on some pros and cons related to it.
The article here would explain the steps to redistribute the data and help remove bloat.
Before redistributing the data you will need to identify the table distribution policy if you are only redistributing a single table, then the quickest way to look out for the distribution policy is:
If the table distribution policy is "random" then the command to use is the following:
alter table <table_name> set with (reorganize=true) distributed randomly;
If the table in question is distributed with a set of columns or a single column, then the command would be the following:
alter table <table_name> set with (reorganize=true) distributed by (<column_names1>,<column_names2>....)