mysql创建Bitmap_Join_Indexes中的约束与索引

时间:2024-01-15 18:25:50 

测试过程如下:
create table sales 
as select * from sh.sales;    

create table customers 

as 
select * from sh.customers; 
create unique index CUST_ID_un on customers(CUST_ID);    

创建: 
Bitmap Join Indexes 

create bitmap index sales_cust_gender_bjix 
on sales(customers.cust_gender) 
from sales,customers 
where sales.cust_id=customers.cust_id; 

报错如下: 

第 3 行出现错误: 
ORA-25954: 维的主键或唯一约束条件缺失
案例分析:在此处尽管定义了对表customers的唯一性索引,但是该索引并没有对表customers并没有唯一性约束,即表示唯一性索引并不表示对表进行唯一性约束;但是如果加了唯一性的约束,就不会出现报错,示例如下:

SQL> ALTER TABLE customers
2 MODIFY (cust_id CONSTRAINT customers_un unique); 
表已更改。

SQL> create bitmap index sales_cust_gender_bjix 

2 on sales(customers.cust_gender) 
3 from sales,customers 
4 where sales.cust_id=customers.cust_id; 

索引已创建。 

结论:

只要加了唯一性的约束,创建BJI则不会报错。 

标签:Bitmap,Join,Indexes,约束,索引
0
投稿

猜你喜欢

  • 解决python3.5 正常安装 却不能直接使用Tkinter包的问题

    2022-09-20 17:40:27
  • KB967723补丁造成的MYSQL在Win2003上频繁连接不上的问题的解决方法

    2024-01-18 11:20:39
  • Python实现计算图像RGB均值方式

    2024-01-01 20:50:31
  • 微信小程序基于数据库时间实现商品倒计时功能(可重用代码)

    2024-01-16 06:05:38
  • CSS模块化设计

    2009-01-05 12:10:00
  • Asp中Server.ScriptTimeOut属性需要注意的一点

    2011-04-27 08:41:00
  • 十个免费的web前端开发工具详细整理

    2023-08-12 17:01:22
  • python实现定时压缩指定文件夹发送邮件

    2022-06-02 19:32:36
  • MySQL SQL预处理(Prepared)的语法实例与注意事项

    2024-01-14 17:50:09
  • 使用动画实现微信读书的换一批效果(两种方式)

    2023-10-23 14:30:55
  • python解析照片拍摄时间进行图片整理

    2023-02-13 07:40:54
  • SQLServer2005 中的几个统计技巧

    2024-01-18 00:28:01
  • 阿里云 Centos7.3安装mysql5.7.18 rpm安装教程

    2024-01-25 07:04:54
  • GO语言中的常量

    2024-05-13 10:44:17
  • 一文详解kubernetes 中资源分配的那些事

    2024-05-22 17:47:57
  • Python2.7.10以上pip更新及其他包的安装教程

    2022-12-17 18:44:55
  • Anaconda安装OpenCV的方法图文教程

    2021-11-30 18:22:09
  • Python 实用技巧之利用Shell通配符做字符串匹配

    2021-07-18 22:57:16
  • aws 通过boto3 python脚本打pach的实现方法

    2021-09-14 23:33:19
  • Django 如何实现文件上传下载

    2021-07-16 02:54:15
  • asp之家 网络编程 m.aspxhome.com