mysql self-summary

What Mysql's underlying index should use B+Tree

Let's talk about the binary tree first: The binary tree takes the first inserted data as the root node. Assuming a certain situation, it becomes a single-chain table, and the query efficiency is extremely slow.
The second is the balanced binary tree. In the case of a large amount of data, the tree will be very high, so our retrieval efficiency is still not high.
Then the tree height of B Tree B tree will not be very high.
B+ tree is optimized under the premise of b tree, and the data is also placed in the leaf nodes.

Group link

When we query, we group according to a certain field, then the field we query can only be our grouping field or an aggregate function. At this time, we can use the group connection function to connect all the other fields.
raw data

Data after group connection

Guess you like

Origin blog.csdn.net/qq_36905956/article/details/112504415