LightDB 创建索引时索引名称支持指定schema

功能简介

在Oracle数据库中,创建对象时支持指定schema。例如:

CREATE table test.test_table(id int PRIMARY KEY, name varchar2(10));
CREATE INDEX test.idx_t10 ON test.test_table (name);

但是LightDB的创建索引语句create index不支持指定schema。所以从Oracle迁移到LightDB后,创建索引语句需要修改后才能使用。

为了兼容Oracle数据库,LightDB数据库从23.2版本支持下列特性:

  1. create index 语句指定schema;
  2. alter index rename to 语句新的index name 指定schema;

这个功能仅仅是语法糖,没有实现实际功能。

用法

create index语句

create table t1(id int);
create index hahaha.index_t1_id on t1(id);
create index if not exists fasdf.index_t1_id2 on t1(id);

alter index rename 语句

create table t1(id int);
create index hahaha.index_t1_id on t1(id);
create index if not exists fasdf.index_t1_id2 on t1(id);
alter index index_t1_id rename to xxww.index_t1_id_1;
alter index if exists index_t1_id2 rename to waha.index_t1_id2_1;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值