一、查看Cuboid数量
二、判断Cube优化的依据
-------------------------------------
一、查看Cuboid数量
$KYLIN_HOME/bin/kylin.sh org.apache.kylin.engine.mr.common.CubeStatsReader CUBE_NAME
CUBE_NAME 想要查看Cube的名字
如下显示:
============================================================================
Statistics of sales_cube[20120101000000_20150101000000]
Cube statistics hll precision: 14
Total cuboids: 47
Total estimated rows: 297857
Total estimated size(MB): 3.809040069580078
Sampling percentage: 100
Mapper overlap ratio: 1.0
Mapper number: 1
Length of dimension DEFAULT.KYLIN_SALES.PART_DT is 3
Length of dimension DEFAULT.KYLIN_SALES.LEAF_CATEG_ID is 1
Length of dimension DEFAULT.KYLIN_SALES.LSTG_SITE_ID is 1
Length of dimension DEFAULT.KYLIN_SALES.SLR_SEGMENT_CD is 1
Length of dimension DEFAULT.KYLIN_SALES.BUYER_ID is 2
Length of dimension DEFAULT.KYLIN_CAL_DT.QTR_BEG_DT is 3
......
|---- Cuboid 101101, est row: 5574, est MB: 0.07, shrink: 56.01%
|---- Cuboid 110111, est row: 10098, est MB: 0.13, shrink: 100.74%
|---- Cuboid 110011, est row: 9951, est MB: 0.13, shrink: 98.54%
|---- Cuboid 110001, est row: 9278, est MB: 0.11, shrink: 93.24%
|---- Cuboid 110101, est row: 10004, est MB: 0.12, shrink: 99.07%
|---- Cuboid 111011, est row: 9938, est MB: 0.13, shrink: 99.14%
|---- Cuboid 111001, est row: 9294, est MB: 0.12, shrink: 93.52%
|---- Cuboid 111101, est row: 9958, est MB: 0.13, shrink: 99.34%
二、判断Cube优化的依据
Cube膨胀率(Expansion Rate)应该为0%~1000%,如果超过这个范围需仔细衡量时间和空间的平衡:
三、优化方式
3.1 减枝优化
3.2 使用衍生维度
3.3 聚合组
3.4 并发粒度优化
在Cube设计下,通过Configuration Overwrites
设置分区,分区数量对应Hbase中的Region数量:
kylin.hbase.region.cut #Segment中一个Cuboid阀值
kylin.hbase.region.max #最大分区数量
kylin.hbase.region.min #最小分区数量
3.5 Rowkey优化
3.6 Top_N度量优化
3.7 Cube Planner优化
更新中................