SELECT relname as TableName, pg_size_pretty(pg_table_size(relid)) as TableSIZE,pg_size_pretty(pg_indexes_size(relid))
as IndexSIZE FROM pg_catalog.pg_stat_user_tables where relname in (select lower(LOOKUP_TABLENAME) from RawMetaTable union all select lower(LOOKUP_TABLENAME) from MEDIANET_MetaTable union all
select lower(LOOKUP_TABLENAME) from APPFLOW_MetaTable union all select lower(LOOKUP_TABLENAME) from ArtFlow_MetaTable union all
select lower(LOOKUP_TABLENAME) from QoSFlow_MetaTable union all select lower(LOOKUP_TABLENAME) from QoSDrop_MetaTable union all
select lower(LOOKUP_TABLENAME) from UrlFlow_MetaTable union all select lower(LOOKUP_TABLENAME) from WLCFlow_MetaTable)
ORDER BY pg_total_relation_size(relid) DESC;
SELECT relname as TableName,pg_size_pretty(pg_table_size(relid)) as TableSIZE,pg_size_pretty(pg_indexes_size(relid)) as
IndexSIZE,n_live_tup as RowCounts FROM pg_catalog.pg_stat_user_tables where relname in (select lower(LOOKUP_TABLENAME) from NFA_MetaTable union all select lower(LOOKUP_TABLENAME) from AvcAppMetaTable union all
select lower(LOOKUP_TABLENAME) from NBAR_MetaTable union all select lower(LOOKUP_TABLENAME) from QOS_MetaTable union all
select lower(LOOKUP_TABLENAME) from MATCH_QOS_MetaTable union all select lower(LOOKUP_TABLENAME) from TopStatsMetaTable union all
select lower(LOOKUP_TABLENAME) from WlcMetaTable union all select lower(LOOKUP_TABLENAME) from WLCTopStatsMetaTable union all
select lower(LOOKUP_TABLENAME) from SocialMediaMetatable)
ORDER BY pg_total_relation_size(relid) DESC;