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让人很费解,使用索引后性能上没有得到提升。
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。