Three major features of the index, example application

Source: Internet
Author: User

Three features of Indexes

1 index height

 

When SQL queries data (select), the indexing efficiency varies significantly depending on the index height, the data block to be read by the database to access the index is usually the index height + the number of data blocks. That is to say, the higher the index height, the more data blocks to be read by the index, and the worse the efficiency.

 

 

From the test above, we can see that as the table index height increases, the consistent reads produced by the query index also increases.

 

2 Index storage column Value

 

By analyzing an index block, we can know that the index block not only stores rowid information, but also stores the value of the index column, this feature can be used when the queried value is in the index or some aggregate calculations (such as sum, Max, min.

 

3. The index itself is ordered.

 

From the index storage structure, we can see that the index storage is stored in an orderly manner. During index scanning, the index starts from the root node and passes through the neck node to the leaf node, in this case, the index range query or equivalent query only needs to scan a range to obtain the results, because the index itself has a range, we can use the index feature to reduce the sorting operations of actual queries.

 

 

In which scenarios will indexes not be used (the index is not valid)

 

. 1. The index cost is higher.

 

2. Index column type conversion occurred.

 

3. perform various operations on the index Column

 

Three major features of the index, example application

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.