数据仓库服务 GAUSSDB(DWS)-列存小CU多导致的性能慢问题:排查方法

时间:2024-11-02 18:44:29

排查方法

查看相关表CU中数据分布情况,以下操作在DN执行。

  1. 查看列存表对应的cudesc表

    针对非分区表:

    1
    SELECT 'cstore.'||relname FROM pg_class where oid = (SELECT relcudescrelid FROM pg_class c inner join pg_namespace n on c.relnamespace = n.oid where relname = 'table name' and nspname = 'schema name');
    

    针对分区表:

    1
    SELECT 'cstore.'||relname FROM pg_class where oid in (SELECT p.relcudescrelid FROM pg_partition p,pg_class c,pg_namespace n where c.relnamespace = n.oid and p.parentid = c.oid and c.relname = 'table name' and n.nspname = 'schema name' and p.relcudescrelid != 0);
    
  2. 查看cudesc中各CU的rowcount情况

    查询步骤一返回的cudesc表信息,查询结果类似如下,主要关注row_count过小(远小于6w)的CU数量,如果此数量较大,说明当前小CU多,CU膨胀问题严重,影响存储效率和查询访问效率。

support.huaweicloud.com/trouble-dws/dws_09_0110.html