title: PSQL - Select size of tables for both partitioned and normal
body: <p>Thanks in advance for any help with this, it is highly appreciated.</p>
  
  <p>So, basically, I have a Greenplum database and I am wanting to select the table size for the top 10 largest tables. This isn't a problem using the below:</p>
  
  <pre><code>select 
  sotaidschemaname schema_name
  ,sotaidtablename table_name
  ,pg_size_pretty(sotaidtablesize) table_size
  from gp_toolkit.gp_size_of_table_and_indexes_disk
  order by 3 desc
  limit 10
  ;
  </code></pre>
  
  <p>However I have several partitioned tables in my database and these show up with the above sql as all their 'child tables' split up into small fragments (though I know they accumalate to make the largest 2 tables). Is there a way of making a script that selects tables (partitioned or otherwise) and their total size?</p>
  
  <p>Note: I'd be happy to include some sort of join where I specify the partitoned table-name specifically as there are only 2 partitioned tables. However, I would still need to take the top 10 (where I cannot assume the partitioned table(s) are up there) and I cannot specify any other table names since there are near a thousand of them.</p>
  
  <p>Thanks again,
  Vinny.</p>