One of the tables in my Postgresql database takes up 25 GB and I want to understand which columns contribute to this size. I suspect that there are 2 columns (both columns allow text with no chars limit) that contribute heavily to the table size. I checked each of the column sizes by using the query below, but their size doesnt add up to 25 GB..Can someone advise me on how I can see the split of 25 GB by column?
select pg_size_pretty(sum(pg_column_size(insert_column_name))) as total_size from insert_table_name
I suspect the above query is giving me the wrong size taken up by each column in the table, because all the individual column sizes add up to only 4-5 GB (when it should add to 25 GB).
- Where is the remaining shortfall of 20GB coming from if the query above is correct?
- Can you advise on what query I can use to see the split of 25GB by columns?