PostgreSQL select result size
问题 I have a table in PostgreSQL DB and make a select from this table with some constraints, and than I want to know how much disk space does this select has. I know that there is a postgres function pg_total_relation_size that gives me the size of some table in DB, but how can I find the 'subtable' size? Any Ideas? I use PostgreSQL 9.1 回答1: To get the data size, allowing for TOAST compression, etc: regress=> SELECT sum(pg_column_size(devices)) FROM devices WHERE country = 'US'; sum ----- 105 (1