hana数据库-索引处理

hana数据库-索引处理

--SAP HANA的索引都是保存在内存中。
--创建索引:
--语法:
CREATE [UNIQUE] [BTREE | CPBTREE] INDEX <index_name> ON <table_name> (<column_name_order>, ...) [ASC | DESC]
--创建测试表:
create row table test_index (id INT,name nvarchar(10), remark nvarchar(10));
create index indextest1 on test_index(name);
CREATE CPBTREE INDEX indextest2 ON test_index(id, name DESC);

--创建唯一键索引:
create unique index indextest4 on test_index(id);
create unique index indextest3 on test_index(name,remark);

--删除索引:DROP INDEX <index_name>
drop index indextest2;--删除索引indextest2
--查询索引:
select * from indexes where table_name ='EMP';  --查询员工表中使用的索引
select * from index_columns  where table_name ='EMP'; --查询索引列
select * from m_rs_indexes  where table_name = 'EMP'; --查询索引的统计信息(B-tree and CPB-tree)
select * from fulltext_indexes where table_name = 'EMP'; --查询Fulltext 索引
select * from m_fulltext_queues; --查看fulltext 索引队列的状态

--修改索引名称
RENAME INDEX <old_index_name> TO <new_index_name>;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值