Summary of the limitations of btree and hash in MySQL

Source: Internet
Author: User

In the index, the limitations of Btree Index and hash index, here a rough list of

1 Btree Limitations

The nodes in the B-tree are stored sequentially, so you can use the index for lookups (some values are found), or you can order by with the query results (note that the primary key is followed by the order by)
1 The query must start at the leftmost column of the index
2 cannot skip an indexed column
3 The storage engine cannot use the column to the right of the range criteria in the index

2 Limitations of the hash

1 can only satisfy "=", "in" and "<=>" query, cannot use range query
2 cannot be used to avoid sorting operations on data
3 cannot use partial index key query
4 can not avoid the table scan at any time
5 performance does not have to be higher than b-tree indexes when encountering a large number of equal hash values

Summary of the limitations of btree and hash in MySQL

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.