postgres.rst
changeset 2511 ead0982db652
parent 2510 cdc491306fef
child 2512 b04ec90c2f8a
equal deleted inserted replaced
2510:cdc491306fef 2511:ead0982db652
   439 
   439 
   440 List tables sizes (and constraints)::
   440 List tables sizes (and constraints)::
   441 
   441 
   442   \d+
   442   \d+
   443 
   443 
       
   444 All tables row count::
       
   445 
       
   446   SELECT relname, n_live_tup FROM pg_stat_user_tables
       
   447   WHERE schemaname = 'public'
       
   448   ORDER BY n_live_tup DESC;
       
   449 
   444 Table total size (with indexes)::
   450 Table total size (with indexes)::
   445 
   451 
   446   SELECT pg_size_pretty(pg_total_relation_size('schemaname.tablename'));
   452   SELECT pg_size_pretty(pg_total_relation_size('schemaname.tablename'));
   447 
   453 
   448 Table size with TOAST (without indexes)::
   454 Table size with TOAST (without indexes)::