select pg_stat_user_tables.relname as tablename,n_live_tup as lines_rowcount,pg_class.reltuples as rowcounts, pg_size_pretty( pg_relation_size(relid)) as tablesize, pg_size_pretty( pg_table_size(relid)) as tablesize_noindexsize ,
pg_size_pretty( pg_indexes_size (relid)) as indexes_size , pg_size_pretty( pg_total_relation_size (relid)) as total_relation_size , pg_total_relation_size (relid) as total_relation_size_int , *
from pg_stat_user_tables
left join pg_class on pg_stat_user_tables.relname=pg_class.relname
where pg_stat_user_tables.relname like '%%' order by total_relation_size_int desc
pg_size_pretty( pg_indexes_size (relid)) as indexes_size , pg_size_pretty( pg_total_relation_size (relid)) as total_relation_size , pg_total_relation_size (relid) as total_relation_size_int , *
from pg_stat_user_tables
left join pg_class on pg_stat_user_tables.relname=pg_class.relname
where pg_stat_user_tables.relname like '%%' order by total_relation_size_int desc