我在hive中建了一个purchase表,然后对purchase表建立索引[mw_shl_code=java,true]create index hive_hbase_visitor2_index on table hive_hbase_visitor2(name) as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' WITH DEFERRED REBUILD in table hive_index_table;
alter index hive_hbase_visitor2_index on hive_hbase_visitor2 rebuild;[/mw_shl_code]然后查询select * from hive_hbase_visitor2 limit 10的执行计划,但执行计划里没有索引描述。[mw_shl_code=java,true]hive> explain select * from hive_hbase_visitor2 limit 10;
OK
STAGE DEPENDENCIES:
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-0
Fetch Operator
limit: 10
Processor Tree:
TableScan
alias: hive_hbase_visitor2
Statistics: Num rows: 33082940 Data size: 661658800 Basic stats: COMPLETE Column stats: NONE
Select Operator
expressions: id (type: string), name (type: string), age (type: int), sex (type: string)
outputColumnNames: _col0, _col1, _col2, _col3
Statistics: Num rows: 33082940 Data size: 661658800 Basic stats: COMPLETE Column stats: NONE
Limit
Number of rows: 10
Statistics: Num rows: 10 Data size: 200 Basic stats: COMPLETE Column stats: NONE
ListSink
Time taken: 0.23 seconds, Fetched: 20 row(s)
[/mw_shl_code] 是索引没有起作用吗?
|