MySQL index push-Down Technology and MySQL index push technology

Source: Internet
Author: User
Tags mysql index

MySQL index push-Down Technology and MySQL index push technology

The whole idea of index push-down is as follows:

To see how this optimization works, consider first how an index scan proceeds when Index Condition Pushdown is not used:

  1. Get the next row, first by reading the index tuple, and then by using the index tuple to locate and read the full table row.

  2. Test the part ofWHERECondition that applies to this table. Accept or reject the row based on the test result.

When Index Condition Pushdown is used, the scan proceeds like this instead:

  1. Get the next row's index tuple (but not the full table row ).

  2. Test the part ofWHERECondition that applies to this table and can be checked using only index columns. If the condition is not satisfied, proceed to the index tuple for the next row.

  3. If the condition is satisfied, use the index tuple to locate and read the full table row.

  4. Test the remaining part ofWHERECondition that applies to this table. Accept or reject the row based on the test result.

Example:

Suppose that we have a table containing information about people and their addresses and that the table has an index definedINDEX (zipcode, lastname, firstname). If we know a person'szipcodeValue but are not sure about the last name, we can search like this:

SELECT * FROM people  WHERE zipcode='95054'  AND lastname LIKE '%etrunia%'  AND address LIKE '%Main Street%';

The people table (zipcode, lastname, firstname) constitutes an index.

If the index push-down technology is not used, MySQL will query the corresponding ancestor from the storage engine through zipcode = '000000' and return it to the MySQL server, then the MySQL server is based on lastname LIKE '% etrunia %' and

Address LIKE '% Main Street %' to determine whether the ancestor meets the conditions.

If index push-down technology is used, MYSQL first returns an index that complies with zipcode = '20160301, then, the lastname LIKE '% etrunia %' and address LIKE '% Main Street %' are used to determine whether the index meets the requirements.

Condition. If the condition is met, the corresponding ancestor is located based on the index. If the condition is not met, the corresponding ancestor is directly reject.

 

 

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.