如何查询数据是否倾斜

最近更新时间: 2024-06-12 15:06:00

连接上不同的 dn 节点,分别查询数据表的容量大小,如果大小偏差较大就可以判断存在数据倾斜。

postgres=# select pg_size_pretty(pg_table_size('TBase_1'));
 pg_size_pretty 
----------------
 2408 kB
(1 row)
postgres=# select pg_size_pretty(pg_table_size('TBase_2'));
 pg_size_pretty 
----------------
 896 kB
(1 row)