1
Simple concept of binary search tree: Under the premise of two-tree, all the nodes on the left subtree are less than/equal to the value of their parent node, and all the points on the right subtree are greater than/
There is a high height of a node
There is the simple concept of a binary balance tree with a balanced binary tree: Under the premise of binary search tree, the maximum difference of height of two subtrees trees of any node is 1 (| bf|<=1) balance factor (BF): bf= Left dial hand tree depth-right subtree depth to maintain the balance of the binary balance tree, the most important thing is to find its smallest unbalanced tree, The smallest unbalance tree can be found in this way: find the node nearest to the insertion point and the absolute value of the balance factor is the root of the subtree, after finding the smallest unbalanced tree, it needs to be balanced, mainly depends on the rotation to achieve how to maintain the balance (3 of the smallest unbalanced tree, 3 rotation mode): A. L: BF <-1 o'clock, the parent node becomes the left node of the Node B. Right: BF> 1 o'clock, the parent node becomes the right node of the node C. left-handed
However, each node of the binary tree corresponds to a maximum of 2 sub-nodes, a lot of nodes, the height of the tree will be very large, look up to traverse the number of layers will be many, efficiency is a problem, so, B + Tree was born. B+ Tree Simple concept: A special balance of the search tree, all the record nodes are key values in order to store the same layer of leaf nodes, each leaf node with a pointer to the cohesion, the key value is small in the left, the key value is large in the right.
Leaf nodes are sequentially traversed from left to right to get the order of all key values, which is why the federated index needs to meet the "leftmost prefix match".
MySQL concept of index-related trees