High performance MySQL (5) Create high-performance index one B-tree index

Source: Internet
Author: User
Tags mysql prefix lookup range

I. Type of index

In MySQL, the index is implemented at the storage engine layer, not the server layer, so there is no uniform standard.

MySQL supports the following types of indexes:

1, B-tree index (also includes B+tree index, collectively referred to as the B-tree index, but the data structure is different, the characteristics are the same)

Using the B-tree data structure to store the information, there is actually a storage engine using B+tree. About Btree, b-tree, B+tree difference please see the attachment of this blog.

InnoDB is the B+tree index used.

B-tree usually means that all values are stored sequentially, and each leaf page to the same distance.

B-tree is stored sequentially on indexed columns, so it is well suited to look for range data.

The B-tree index is suitable for a full key value, a key value range, or a key prefix lookup, where the key prefix lookup is suitable only for lookups based on the leftmost prefix.

An example is provided:

The data are as follows:

A, full value matching

Matching all columns in an index must be in the order defined by the index, such as:

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.