Create constraints and indexes in Bitmap_Join_Indexes _ MySQL

Source: Internet
Author: User
Creating constraints and Indexes in Bitmap_Join_Indexes: When creating Bitmap Join Indexes, an ORA-25954 error occurs: a dimension primary key or a unique constraint condition is missing.

Cause: it is affected by constraints and indexes.

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

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 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

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.