一.目的

  优化查询以及检索性能

二.创建索引

  create index index_user on table user(name)

  as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandle' wiith deferred rebuild

  in table index_user_table;

  备注:

  as:指定索引器;

  in table:指定索引表,若不指定默认生成在default_user_t1_index_表中;

三.查询索引

  show index on user;

四.重建索引

  alter index index_user on user rebuild;

  注意:创建索引之后必须重建索引才能生效!

五.删除索引

  drop index if exists index_user on user;

相关文章:

  • 2021-12-29
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2021-07-26
  • 2021-05-12
猜你喜欢
  • 2021-10-24
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-04-14
相关资源
相似解决方案