查找数据库中各种对象的大小这将以原始字节和“漂亮”形式报告所有表的大小信息。SELECT *, pg_size_pretty(total_bytes) AS total , pg_size_pretty(index_bytes) AS INDEX , pg_size_pretty(toast_bytes) AS...

Vicw.com用户头像 - XanderCheung XanderCheung 6736 0 1

SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;

Vicw.com用户头像 - XanderCheung XanderCheung 549 0 0

查看所有数据库的容量 SELECT table_schema AS '数据库', sum( table_rows ) AS '记录数', sum( TRUNCATE ( data_length / 1024 / 1024, 2 )) AS '数据容量(MB)', sum( TRUNCATE ( index_length / 1024 / 1024, ...

Vicw.com用户头像 - XanderCheung XanderCheung 569 0 0