Wednesday, 14 August 2024

Query to check Table Size

 

/*Query to check Table Size*/
———————————————————————————————————–

SELECT relnamespace::regclass, relname,pg_size_pretty(pg_relation_size(pg_class.oid, ‘main’)) as main, pg_size_pretty(pg_relation_size(pg_class.oid,’fsm’)) as fsm, pg_size_pretty(pg_relation_size(pg_class.oid, ‘vm’)) as vm, pg_size_pretty(pg_relation_size(pg_class.oid, ‘init’)) as init, pg_size_pretty(pg_table_size(pg_class.oid)) as table, pg_size_pretty(pg_indexes_size(pg_class.oid)) as indexes, pg_size_pretty(pg_total_relation_size(pg_class.oid)) as total FROM pg_class WHERE relkind=’r’ ORDER BY pg_total_relation_size(pg_class.oid) DESC LIMIT 10;

No comments:

Post a Comment

Master and Slave - Sync check - PostgreSQL

  1) Run the below Query on Primary:- SELECT     pid,     usename,     application_name,     client_addr,     state,     sync_state,     sen...