欢迎投稿

今日深度:

hive 索引,

hive 索引,


设置索引:
hive> set hive.optimize.index.groupby=false;
hive> set hive.optimize.index.filter=true;                      


注意 hive.optimize.index.groupby必须设置生false,不然 hive.optimize.index.filter不起作用。


hive> explain select count(1) from ctest where dp_id='10275499';

STAGE PLANS:
  Stage: Stage-3
    Map Reduce
      Alias -> Map Operator Tree:
        taobao_db__aatest_aatestindex__ 
          TableScan
            alias: taobao_db__aatest_aatestindex__
            filterExpr:
                expr: (tid = '57301233')
                type: boolean
            Filter Operator
可以发现会执行索引。


然而:

不使用索引cpu耗时:

Total MapReduce CPU Time Spent: 1 minutes 45 seconds 300 msec
使用索引cpu耗时:

Total MapReduce CPU Time Spent: 5 minutes 2 seconds 250 msec
让人很费解,使用索引后性能上没有得到提升。


www.htsjk.Com true http://www.htsjk.com/hive/39418.html NewsArticle hive 索引, 设置索引: hive set hive.optimize.index.groupby=false; hive set hive.optimize.index.filter=true;                       注意 hive.optimize.index.groupby必须设置生false,不然 hive.optimize.index.filt...
相关文章
    暂无相关文章
评论暂时关闭