Oracle Performance Optimization Operation 7: Index improves query efficiency when data distribution is uneven, and oracle Performance Optimization

Source: Internet
Author: User

Oracle Performance Optimization Operation 7: Index improves query efficiency when data distribution is uneven, and oracle Performance Optimization

Index selection is low, but the data value distribution is very different, you can still use the index to improve efficiency.

A. In special cases where the data distribution is uneven, the index with low selectivity should also be created.

The ServiceInfo table contains a large amount of data. Assume there are 1 million rows, with a DisposalCourseFlag field. The value range is [,].

According to the index rules described above, "the index should not be created for fields with low selectivity ",

This field has only eight values, the index value repetition rate is very high, and the index selectivity is very low, so no index is created.

However, the distribution of data values in this field is very special, as shown in the following table:

Percentage of data in the value range
1 ~ 5 1%
6 98%
7 1%

In addition, in common queries, the query of DisposalCourseFlag <6 is both frequent and frequent. If an index can be created and applied,

This will greatly improve the query efficiency in this case. Therefore, we need to create an index on this field.

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.