MySQL creates constraints and indexes in bitmap_join_indexes.

Source: Internet
Author: User

The test procedure is as follows:
Create Table sales
As select * From Sh. sales;

Create Table MERs

As
Select * From Sh. customers;
Create unique index cust_id_un on MERs (cust_id );

Create:
Bitmap join Indexes

Create bitmap index sales_cust_gender_bjix
On Sales (customers. cust_gender)
From sales, MERS MERs
Where sales. cust_id = customers. cust_id;

The following error is reported:

Row 3 has an error:
ORA-25954: Missing primary key or unique constraint for a dimension
Case study: although the unique index of table MERs Mers is defined here, this index does not have a unique constraint on table customers, that is, it does not mean that the table is unique; however, if the uniqueness constraint is added, no error is reported. The example is as follows:

SQL> ALTER TABLE MERs
2 modify (cust_id constraint customers_un unique );
The table has been changed.

SQL> Create bitmap index sales_cust_gender_bjix

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

The index has been created.

Conclusion:

As long as the uniqueness constraint is added, no error is reported when you create bji.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.