Oracle Technology: Impact of indexes and null values on hints and execution plans

Source: Internet
Author: User

Because the B*tree index does not store null values, some Oracle queries do not use indexes when the indexed field is allowed to be empty.

Most of the time, it appears that we can use a full index scan, which may give Oracle the chance to discard the index because of the existence of the null value (Scan).

In this case, the index is not used even with hints,oracle, because of the existence of null values.

Let's look at the following tests.

The Index hints can take effect when the username field is not null.

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Oracle discards this index when the index field is allowed to be null:

When the field is not NULL, the index can be forced to use:

This is the effect of null values on indexes and queries.

Author: 51cto Oracle small-mixed son

Related Article

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.