|NO.Z.00016|——————————|BigDataEnd|——|Hadoop&OLAP_Kylin.V16|——|Kylin.v16|Cube优化|检查Cuboid数量|

一、检查Cuboid数量
### --- 检查Cuboid数量

~~~     Apache Kylin提供了一个简单的工具,
~~~     检查Cube中哪些Cuboid最终被预计算了,称这些Cuboid为被物化的Cuboid,
~~~     该工具还能给出每个Cuboid所占空间的估计值。
~~~     由于该工具需要在对数据进行一定阶段的处理之后才能估算Cuboid的大小,
~~~     一般来说在Cube构建完毕之后再使用该工具。
### --- 使用如下的命令行工具去检查这个Cube中的Cuboid状态:

[root@hadoop02 ~]# kylin.sh org.apache.kylin.engine.mr.common.CubeStatsReader yanqi_sales_cube4
============================================================================
Statistics of yanqi_sales_cube4[20211001000000_20211002000000]

Cube statistics hll precision: 14
Total cuboids: 15
Total estimated rows: 101
Total estimated size(MB): 0.0013644695281982422
Sampling percentage:  100
Mapper overlap ratio: 1.0
Mapper number: 1
Length of dimension YANQI_KYLIN.DW_SALES1.DT is 1
Length of dimension YANQI_KYLIN.DW_SALES1.PRODUCTID is 1
Length of dimension YANQI_KYLIN.DW_SALES1.CHANNELID is 1
Length of dimension YANQI_KYLIN.DW_SALES1.REGIONID is 1
|---- Cuboid 1111, est row: 18, est MB: 0
    |---- Cuboid 0111, est row: 18, est MB: 0, shrink: 100%
        |---- Cuboid 0011, est row: 6, est MB: 0, shrink: 33.33%
            |---- Cuboid 0001, est row: 2, est MB: 0, shrink: 33.33%
            |---- Cuboid 0010, est row: 3, est MB: 0, shrink: 50%
        |---- Cuboid 0101, est row: 8, est MB: 0, shrink: 44.44%
            |---- Cuboid 0100, est row: 4, est MB: 0, shrink: 50%
        |---- Cuboid 0110, est row: 9, est MB: 0, shrink: 50%
    |---- Cuboid 1011, est row: 6, est MB: 0, shrink: 33.33%
        |---- Cuboid 1001, est row: 2, est MB: 0, shrink: 33.33%
            |---- Cuboid 1000, est row: 1, est MB: 0, shrink: 50%
        |---- Cuboid 1010, est row: 3, est MB: 0, shrink: 50%
    |---- Cuboid 1101, est row: 8, est MB: 0, shrink: 44.44%
        |---- Cuboid 1100, est row: 4, est MB: 0, shrink: 50%
    |---- Cuboid 1110, est row: 9, est MB: 0, shrink: 50%
----------------------------------------------------------------------------
### --- 输出结果分析:
~~~     估计Cuboid大小的精度(Hll Precision)
~~~     总共的Cuboid数量
~~~     Segment的总行数估计
~~~     Segment的大小估计,Segment的大小决定mapper、reducer的数量、数据分片数量等

============================================================================
Statistics of yanqi_sales_cube4[20211001000000_20211002000000]
~~~省略部分参数
Cube statistics hll precision: 14
Total cuboids: 15
Total estimated rows: 101
Total estimated size(MB): 0.0013644695281982422
Sampling percentage:  100
Mapper overlap ratio: 1.0
Mapper number: 1
~~~省略部分参数
----------------------------------------------------------------------------
============================================================================
Statistics of yanqi_sales_cube4[20211001000000_20211002000000]
~~~省略部分参数
|---- Cuboid 1111, est row: 18, est MB: 0
    |---- Cuboid 0111, est row: 18, est MB: 0, shrink: 100%
        |---- Cuboid 0011, est row: 6, est MB: 0, shrink: 33.33%
            |---- Cuboid 0001, est row: 2, est MB: 0, shrink: 33.33%
            |---- Cuboid 0010, est row: 3, est MB: 0, shrink: 50%
        |---- Cuboid 0101, est row: 8, est MB: 0, shrink: 44.44%
            |---- Cuboid 0100, est row: 4, est MB: 0, shrink: 50%
        |---- Cuboid 0110, est row: 9, est MB: 0, shrink: 50%
    |---- Cuboid 1011, est row: 6, est MB: 0, shrink: 33.33%
        |---- Cuboid 1001, est row: 2, est MB: 0, shrink: 33.33%
            |---- Cuboid 1000, est row: 1, est MB: 0, shrink: 50%
        |---- Cuboid 1010, est row: 3, est MB: 0, shrink: 50%
    |---- Cuboid 1101, est row: 8, est MB: 0, shrink: 44.44%
        |---- Cuboid 1100, est row: 4, est MB: 0, shrink: 50%
    |---- Cuboid 1110, est row: 9, est MB: 0, shrink: 50%
----------------------------------------------------------------------------
~~~     所有的 Cuboid 及它的分析结果都以树状的形式打印了出来
~~~     在这棵树中,每个节点代表一个Cuboid,每个Cuboid都由一连串1或0的数字组成
~~~     数字串的长度等于有效维度的数量,从左到右的每个数字依次代表Rowkeys设置中的各个维度。
~~~     如果数字为0,则代表这个Cuboid中不存在相应的维度;
~~~     如果数字为1,则代表这个Cuboid中存在相应的维度
~~~     除了最顶端的Cuboid之外,每个Cuboid都有一个父亲Cuboid,且都比父亲Cuboid少了一个“1”。
~~~     其意义是这个Cuboid就是由它的父亲节点减少一个维度聚合而来的(上卷)
~~~     最顶端的Cuboid称为Base Cuboid,它直接由源数据计算而来。
~~~     Base Cuboid中包含所有的维度,因此它的数字串中所有的数字均为1
~~~     每行Cuboid的输出中除了0和1的数字串以外,
~~~     后面还有每个Cuboid的具体信息,包括该Cuboid行数的估计值、该Cuboid大小的估计值,
~~~     以及这个Cuboid的行数与父亲节点的对比(Shrink值)
~~~     所有Cuboid行数的估计值之和应该等于Segment的行数估计值,
~~~     所有Cuboid的大小估计值应该等于该Segment的大小估计值。
~~~     每个Cuboid都是在它的父亲节点的基础上进一步聚合而成的

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(18)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示