pg数据库表的大小

SELECT
table_schema || '.' || table_name AS table_full_name,
pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) AS size
FROM
information_schema.tables
WHERE
table_schema NOT IN ('information_schema', 'pg_catalog')
ORDER BY
pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') DESC;

posted @ 2025-10-23 09:22  TryMyBest!  阅读(3)  评论(0)    收藏  举报