B +, B.-tree in MySQL

Source: Internet
Author: User

1. Basic two-tree lookup

The level of each node is 2, so the time complexity of the lookup, O (log2 N)

2.b-Tree

Each node will contain a key array, a point array, and data.

The size of the key is the out-of-size, denoted by D, so the time complexity of the lookup is O (LOGD), so the efficiency

much higher.

3.b+ Tree

The maximum number of points per node is 2d, not 2d+1,

There is no data field on the node, which is more suitable for the external storage index structure.

Many real-world storage systems implement sequential access pointers based on the classic B + tree, where leaf nodes can access adjacent nodes.

4.DB Why use B-(b +) trees inside

Each time you create a new node, you can request a page space to ensure that the size of a page is physically, so that access to a node requires only one IO,

In addition, the complexity of the time is very low.

Reference: http://blog.codinglabs.org/articles/theory-of-mysql-index.html


O(Log2N)O (log2n)

 

B +, B.-tree 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.