Get sizes of materialized views, indexes and tables

SELECT relname   AS objectname
     , relkind   AS objecttype
     , reltuples AS entries
     , pg_size_pretty(pg_table_size(oid)) AS SIZE  
FROM   pg_class
WHERE  relkind IN ('r', 'i', 'm')
ORDER  BY pg_table_size(oid) DESC;
 
Relkinds:
 
r = ordinary TABLE,
i = INDEX,
S = SEQUENCE,
v = VIEW,
m = materialized VIEW,
c = composite TYPE,
t = TOAST TABLE,
f = FOREIGN TABLE
faq/support/postgresql/object_sizes.txt · Last modified: 2019/04/10 08:51 by 127.0.0.1
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0