创建分区表
|
|
分区前后性能对比
分区前后复杂sql的执行时间对比,单位是秒
分区前 | 分区后 |
---|---|
3.666 | 2.836 |
7.105 | 2.873 |
4.763 | 2.624 |
6.018 | 3.070 |
5.024 | 2.310 |
3.101 | 1.967 |
5.357 | 3.095 |
查看表空间大小
查看指定表大小
1select pg_size_pretty(pg_relation_size('test'));查看指定schema下所有表大小
1select relname, pg_size_pretty(pg_relation_size(relid)) from pg_stat_user_tables where schemaname='public' order by pg_relation_size(relid) desc;
附录
copy
|
|
检查schema是否存在
|
|
检查table是否存在
|
|