Python全系列 教程
3567个小节阅读:5931k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
目的:优化查询以及提交检索性能
创建索引:
xxxxxxxxxx
create index indexName on table tableName(columnName)
as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild
in table t1_index_table;
as:指定索引器;
in table:指定索引表,若不指定默认生成在
default__tableName_indexName__
表中
在person2表的name列上创建索引(不指定索引表)
xxxxxxxxxx
create index t1_index on table person2(name)
as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild;
# 默认多出一个名称 default__person2_t1_index__,开始时是一个空表
查询索引:
xxxxxxxxxx
show index on tableName
重建索引(建立索引之后必须重建索引才能生效):
xxxxxxxxxx
ALTER INDEX indexName ON tableName REBUILD;
删除索引:
xxxxxxxxxx
DROP INDEX indexName ON tableName;
注意:索引在hive3.0+不适用,在hive3.0以前的版本可以使用。