当前位置:网站首页>Plant a seed and grow into a towering b+ tree ten years later
Plant a seed and grow into a towering b+ tree ten years later
2022-07-19 02:32:00 【HYYyyying】
List of articles
One 、B+ The advantages of trees &B+ Trees and B Tree comparison
1、B+ The tree is convenient to sweep the library
For range lookup , b + The tree only needs to traverse the leaf node list , And no sorting operation is required , Because the leaf node has modified the index The sorting operation . b Trees need to be traversed in the middle order repeatedly , Find all nodes in the range .
2、B+ Tree disk is cheaper to read and write
B+ The middle node of the tree does not save data , So the disk page can hold more node elements , more “ Short and fat ”. B Trees, whether leaf nodes or non leaf nodes spot , Data will be saved , This results in a smaller number of pointers that can be saved in a non leaf node ( Some materials are also called fan outs ) , Few pointers Save a lot of data in the next , Can only increase the height of the tree , Lead to IO More operations , Query performance becomes low ;
3、B+ Tree query efficiency is more stable
b + Tree queries must find leaf nodes , b Just go back to the matching tree . therefore b + Tree search is more stable ( Not slow ) , Must check Find the leaf node ; and B Trees , If the data is at the root node , The fastest , The slowest at the leaf node , Query efficiency is not stable .
Two 、B+ Comparison between red and black trees
Red black tree is a self balanced binary search tree , Also known as " Symmetrical binary B Trees ", It can be O(logn) Use in time O(logn) Space to complete the search 、 Insert 、 Delete operation . The read operation of red black tree is the same as that of ordinary binary search tree , The insertion and deletion operations may break the rules of the red black tree , Recovery operation is required . Restoring the nature of red and black trees requires a small amount of color change ( It's actually very fast ) And no more than three tree rotations ( For the insert operation, it's twice ), Although insertion and deletion are complex , But the operation time can still be kept as O(logn).
difference :
The difference between the two kinds of trees
The data of red black tree structure often exists in main memory , It is mainly used to quickly find . The amount of data stored in each node of the tree is relatively small ,cpu Through a small amount of interaction with the main memory, you can get all the data of the tree , And quickly find the required data . and B+ Tree data often exists in SSD Or on disk , Because the depth of the tree is relatively small ( commonly 3~4), Can reduce the cpu Interaction time between disks .
3、 ... and 、B+ Comparison between tree and balanced tree
Four 、 Comparison between red black tree and balanced tree
边栏推荐
- Unity3D 游戏人物跳跃落地时发生弹跳,偏移情况的解决方法
- bugku----正则匹配,cookies
- Interpretation of concurrent virtual users, RPS and TPS
- Experience in using flow playback tool Gor
- SSTI模板注入
- [hdrp HD rendering pipeline] create hdrp project and upgrade the built-in pipeline project to hdrp project
- UE4 notes
- 【Unity开发小技巧】Unity混音器Mixer控制全局音量
- Next array - circular section
- Project Performance Optimization Practice: solve the white screen problem of the home page, customize the loading animation to optimize the first screen effect
猜你喜欢

Jmeter响应时间测试组件&多接口并发

Network layer protocol and IP packet format (detailed)
![[Ruiji takeout ⑩] rough learning of Linux & rough learning of redis](/img/2f/9788ddea24f090d872ccdf82ccd8d8.png)
[Ruiji takeout ⑩] rough learning of Linux & rough learning of redis

攻防世界----easytornado笔记

postman的json脚本转jmeter的jmx脚本
![[unity development tips] unity packs the EXE on the PC side and compresses and packs it into an EXE file](/img/b1/6ca7164d218c179918bb2497ab5fa3.png)
[unity development tips] unity packs the EXE on the PC side and compresses and packs it into an EXE file

General knowledge of network (detailed)

项目性能优化实战:解决首页白屏问题,自定义 loading 动画优化首屏效果

bugku----正则匹配,cookies

新手如何配置多个 SSH Key(通俗易懂手把手教学)
随机推荐
30分钟搞懂 HTTP 缓存
How to use nmon
全链路压测
新手如何配置多个 SSH Key(通俗易懂手把手教学)
使用JMeter测试基于WebSocket协议的服务
ctfhub--ssrf
After unity imports the FBX model, the rotation and position of the object will change automatically at runtime
status 500 reading AftersaleService#getAftersaleList(Long)+com.sun.proxy.$Proxy214.getAftersaleList
[Ruiji takeout ⑩] rough learning of Linux & rough learning of redis
简单记录一下并查集
面试:接口和抽象类的区别-简洁的总结
Lecture 2 BTC cryptography principles (notes)
登录功能的测试点大全
Jmeter响应时间测试组件&多接口并发
理解:什么是接口,接口的概念
【Unity编辑器扩展】Unity资产预处理和后处理图片自动转Sprite2D
【Unity编辑器扩展】Unity发布资源到商店流程Unity Asset Store Publish
Network layer transmission protocol (detailed)
[antv G2] how to add a click event to the line chart (click anywhere to get the value of the point on the line)
Nmon使用方法