当前位置:网站首页>Gbase 8s index b+ tree
Gbase 8s index b+ tree
2022-06-25 04:33:00 【Eight delicacies tofu】
Database commonly used Index structure Yes Binary search tree 、B Trees ,B+ Trees 、Hash、 Bitmap and R Trees , One of the most widely used is B+ Trees . This section focuses on description B+ Tree index structure . B+ Trees can be seen as improved B Trees , Introducing B+ Before the tree , Let's take a look first B Index structure of tree , As shown in the figure .B The tree organizes the storage blocks into a tree , The tree is always in balance , That is, all leaf nodes always have the same depth .B There are three kinds of nodes in the tree : The root node 、 Branch nodes and leaf nodes . The root node points to multiple branch nodes , Branch nodes point to leaf nodes , The leaf node points to the actual data row address .

A tree m rank B A tree is a balanced one m Path search tree , Each storage block ( node ) Storage m Two keywords and m+1 A pointer to the . It's either an empty tree , Or a tree that satisfies the following properties .
- The root node contains at least two child nodes , That is, at least two pointers are used , Each pointer points to B The next level of the tree stores blocks .
- Always keep the data in order , The keywords in each storage block are arranged in ascending order .
- The branch node must have at least (m +1)/2 Two pointers are used . Suppose that... Is used in a block j Key words , Set to K1,K2,…,Kj(K1<K2<…<Kj), Then this block has j +1 Two pointers are used , Each pointer points to B The next node in the tree . The first pointer points to the keyword less than K1 The recording part of , The second pointer points to a keyword greater than or equal to K1 And less than K2 The recording part of , And so on , The first j Pointers to keywords greater than or equal to Kj-1 And less than Kj The recording part of , The last pointer points to a keyword greater than or equal to Kj The recording part of .
- In a leaf node, the last pointer points to the next leaf node to its right , That is, the next key is larger than its storage block . other m Pointers must have at least (m +1)/2 Used , Each pointer points to the actual data record . If the first j Two pointers are used , Then it points to the first in the block j Records of keywords .
therefore , These nodes can be incompletely populated , The filling degree of each node ( That is, the number of keywords ) Must be greater than a minimum percentage value , The rest of the unfilled space is wasted .

B This storage structure of the tree guarantees the search 、 The time complexity of insert and delete operations is in the logarithmic order . Recursively find from root to leaf nodes when searching , Will need to find the keyword and root node ( Branch nodes ) The keywords in are compared ( You can use sequential search or binary search ), Find the interval where the keyword exists , Recursively find the next node according to the pointer , Until the leaf node , You can find the actual data row address pointed to by the leaf node . Insertion time ,B The tree grows from the bottom , When a node overflows ( There are more keywords than m individual ) when , Nodes are automatically split , The new node will be promoted to a higher level , When deleting, the operation is just the opposite .
In order to further understand B Tree structure , The following is an example of a node split caused by inserting data , Pictured 8.5 Shown . It is assumed that each node can only store 4 Key words (m = 4), Then when one is full 4 When a record is added to a node with keywords , The nodes will split , And promote the keywords in the middle to the upper level . Keyword promotion may cause the upper level nodes to continue to split , If the root node is full 4 Key words , Then the root node will split , A new root node will be created when the tree height is increased by one layer . After the split , There will be free locations in the nodes , You can use... When adding a new record .
stay GBase 8s In the database ,B+ The index structure of the tree is shown in Figure 8.7 Shown , Each inode is bi-directional , Both have pointers to the previous and next sibling nodes , In this way, you can query the range , Positive and negative searches can also be performed among peers , The performance of index in data search is greatly improved . The ability of a node to jump left or right to its sibling node is B+ A bright spot in the tree ,GBase 8s All non multidimensional data indexes in the database are B+ Tree index .
边栏推荐
- Read lsd-slam: large scale direct monolithic slam
- GBASE 8s的多线程结构
- NFT insider 63: the sandbox reached a cooperation with Time magazine, and YGG established Spain's subdao
- 什么是存储引擎以及MySQL常见的三种数据库存储引擎
- Gbase 8s stored procedure syntax structure
- 论文笔记: 多标签学习 ESMC (没看懂, 还没写出来, 暂时放这里占个位置)
- Record small knowledge points
- Lecture record: history and development of strapdown inertial navigation solution
- What is data persistence?
- GBASE 8s的数据导入和导出
猜你喜欢
![L'épée leetcode fait référence au chemin leetcode de l'offre II 091 pour peindre la maison [planification dynamique] heroding](/img/ad/69fce7cf064479a0ddd477fb935de2.png)
L'épée leetcode fait référence au chemin leetcode de l'offre II 091 pour peindre la maison [planification dynamique] heroding

CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)

Gbase 8s index R tree

GBASE 8s 索引R树

CTF_ Web: Advanced questions of attack and defense world expert zone WP (15-18)

简单的恶意样本行文分析-入门篇

Lecture record: data processing methods and applications of various spatial geodetic techniques

Coinlist queuing tutorial to improve the winning rate

UCLA | 用于黑盒优化的生成式预训练
![Leetcode points to the leetcode road of offering II 091 house painting [dynamic planning] heroding](/img/ad/69fce7cf064479a0ddd477fb935de2.png)
Leetcode points to the leetcode road of offering II 091 house painting [dynamic planning] heroding
随机推荐
Laravel document sorting 3. CSRF protection
Retrofit 源码分析
SQL injection details
Communication problems in parent and child components of uniapp
Summary of various problems encountered by cocos2d-x
GBASE 8s的触发器
GBASE 8s的多线程结构
CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone
Cascading deletion of gbase 8s
Retrofit source code analysis
Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'
讲座记录《捷联惯导解算的历史及发展》
Thorough understanding of database transactions
2021.4.15 note the difference between let, const and VaR in ES6
mongodb集群
第二十五周记录
GBASE 8s的数据导入和导出
PHP extracts and analyzes table contents, and collects bidding information
LeetCode 剑指Offer II 091 粉刷房子[动态规划] HERODING的LeetCode之路
CTF_ Web:8-bit controllable character getshell