当前位置:网站首页>Multitree -- > b tree and b+ tree
Multitree -- > b tree and b+ tree
2022-07-18 17:36:00 【Xuanxuan won't be bald】
Trees : Including binary tree and multi tree
There is also B Trees and B+ Trees
B Trees
B The characteristics of the tree :
①B The data storage of the tree is :key-value The type of
②B How many forks there are in a tree is uncertain , It depends on the specific implementation
③M rank B Trees
There are at most M-1 It's worth , And in ascending order
(5 rank B Trees : Each node can have at most 4 It's worth )
The main function of memory is to cpu Provide data
for example , Here is a 5 rank B Count :
B The tree is based on key Value for sorting
Why can a red black tree be a binary tree with optimal memory , There will be more B The emergence of trees ?
Red and black trees and B The tree is in memory ----> Memory to CPU The time to provide data is equal , Red and black tree B Compare trees , The number of data comparisons is less , So the red black tree is the best binary tree in memory .
And red and black trees and B Tree on disk , Data addressing ( Physical time of head movement + The average disk rotates half a turn ) A waste of time ,B Trees are mostly used for disks , as a result of : Split out multiple forks , Lower the height of the tree , Time to reduce addressing times
B+ Trees
B+ Trees are MySQL Database specific underlying data structure
B+ The characteristics of the tree :
① Non leaf nodes only have indexing function , That is, non leaf nodes , Can only store key value , Can't store value value
② B+ All leaf nodes of the tree form a linked list , This can be based on key Value traverses the data
for example : Here is a B+ Trees 
Disk to CPU Save the data , Each time you need to push a page of data ( Every time you need to push to the disk 4kb)
B+ The advantages of trees :
①B Trees : Non leaf nodes do not contain data , Index only , In this way, more can be transferred to memory each time key value , Compare data in memory , Query data on disk ;
② Leaf nodes are connected , It is conducive to interval query :
select * from user where key >= 10 and key <=18;`
边栏推荐
猜你喜欢

Image verification, slider verification solution

多米诺骨牌上演:三箭资本崩盘始末

数据湖(十一):Iceberg表数据组织与查询

Why should slab be dyed

【CVA估值训练营】如何快速读懂上市公司年报(第一讲)
![[actual combat] 1382- Yiwen owns your puppeter crawler application](/img/27/9fa894ca227f16d1fe3a1a865ef7af.jpg)
[actual combat] 1382- Yiwen owns your puppeter crawler application
![[CVA valuation training camp] how to quickly read the annual reports of listed companies (Lecture 1)](/img/a7/32754c1cded580d739fac44d5eb5cb.png)
[CVA valuation training camp] how to quickly read the annual reports of listed companies (Lecture 1)

An excellent graphical tool for information collection maltego

“野指针”和大厂经典的动态内存错误笔试题

IDEA解决内存不足 low memory(亲测好用)
随机推荐
文件解析漏洞详解
Ericsson asked for prohibition on the grounds of infringement, and apple returned to the United States to counterclaim. This scene is so familiar
支付宝沙箱测试手机网站支付,提示商户合作协议已到期,无法继续使用
C# 程序调试和异常处理(try catch)
ipfs记录
Stc8h development (XIV): I2C drive rx8025t high-precision real-time clock chip
PostgreSQL source code (8) xlog initialization
V831 - QR code recognition
PostgreSQL source code (7) xlog format
Flink1.7 from installation to experience
HCIA-R&S自用笔记(6)(网络层)ICMP、IP协议基础及分片
The first China Digital Collection conference was successfully held
渗透测试工具 - msf生成后门免杀
Pytest+allure custom report
电脑PC与S7-200SMART PLC不在同一网段,如何建立通信连接?
About the problem that the valueint of cjson exceeds the integer range
求素数
自建个性化自动报价系统,应对多变报价模式
Njupt "Xin'an numeral base" Chapter 11 introduction to problem solving
pytest+allure定制报告