Friday, September 20, 2024

PostgreSQL command tools

 

Database size

select pg_size_pretty( pg_database_size('dbname') );


Tables order by size

select
  table_name,
  pg_size_pretty(pg_total_relation_size(quote_ident(table_name))),
  pg_total_relation_size(quote_ident(table_name))
from information_schema.tables
where table_schema = 'public'
order by 3 desc;



References:

https://stackoverflow.com/questions/21738408/postgresql-list-and-order-tables-by-size

 


No comments:

Upgrade old Android to 10 in Sony Xperia

 https://dev.androidfilehost.com/?w=files&flid=295879&sort_by=name&sort_dir=ASC  https://twrp.me/sony/sonyxperia10.html   https:...