postgresql查询表的大小

postgresql查询表的大小

 

一、查询sql

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 
ORDER BY
    pg_total_relation_size ( '"' || table_schema || '"."' || TABLE_NAME || '"' ) DESC 
    LIMIT 20;

 

二、结果展示

postgresql查询表的大小

 

 

~~~ 完美!

上一篇:如何查询postgresql数量?


下一篇:执行pg_ctl命令报不支持的16位应用程序