Oracle sub-table foreign keys do not need to be indexed

Source: Internet
Author: User

In general, the foreign key of the Oracle sub-table needs to be indexed,

If no index is added to the foreign key, modifying the parent table will lock the child table.

1. Update the primary key of the parent table, and the child table will be locked.

2. delete a row from the parent table. The entire sub-table will be locked.

3. merged to the parent table. The child table is locked. (9i, 10g is the case, 11g is not ).

If the following three conditions are met, you do not need to create an index with the foreign key

1. Data is not deleted from the parent table.

2. The primary key of the parent table is not updated.

3. No parent table is associated with the child table

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.