Oracle 10g中unique与index的问题 create table test ( x integer, y integer, z integer ); alter table test add constr
oracle 10g中unique与index的问题
create table test
(
x integer,
y integer,
z integer
);
alter table test add constraint primary key (x); --产生一个约束,并产生一个同名索引
create unique index index01 on test(x,y);
--create unique index index02 on test(x,y); --不允许完全相同的索引,即使索引名称不同
create unique index index03 on test(y,z);
create unique index index04 on test(z,y); --index04 是与index03互不相同的索引
alter table test add constraint cons01 unique(x,y,z) ; --产生一个约束,并自动产生一个名为cons01 的UNIQUE索引
alter table test add constraint cons01 unique(x,y) ; --产生一个约束,但因与index01 重复(自动产生的索引不区分顺序),因此不能自动产生索引
alter table test add constraint cons01 unique(y,x) ; --产生一个约束,但因与index01 重复,因此不能自动产生索引
--create unique index cons01 on test(x,y); --不能执行,因为索引cons01 已经被约束cons01 自动创建的索引占用
alter table test add constraint cons012 check (x>100);
alter table test add constraint cons013 check (x>100); --check可以内容完全相同
处理办法:
提取所有约束(UCPR)
提取名称不在约束表中的所有索引
本文永久更新链接地址:
,
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
C++高性能并发应用_C++如何开发性能关键应用
Java AI集成Deep Java Library_Java怎么集成AI模型部署
Golang后端API开发_Golang如何高效开发后端和API
Python异步并发改进_Python异步编程有哪些新改进
C++系统编程内存管理_C++系统编程怎么与Rust竞争内存安全
Java GraalVM原生镜像构建_Java怎么用GraalVM构建高效原生镜像
Python FastAPI异步API开发_Python怎么用FastAPI构建异步API
C++现代C++20/23/26特性_现代C++有哪些新标准特性如modules和coroutines
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号