Download presentation
Presentation is loading. Please wait.
Published byMarshall Lester Modified over 9 years ago
1
Announcements Exam Friday
2
More Physical Storage Lecture 10
3
Example B+ Tree 100 200 15 60 120 150 1 8 15 25 30 60 75 80200 215 230 240 270 300 100 115 120 145 150 165 230 270 18
4
Rules for Constructing a B+ Tree If the root is not a leaf, it must have at least two children If the tree is order n, each interior node (that is, all nodes except the root and leaf nodes), must have between n/2 and n occupied pointers (and children). If n/2 is not an integer, roundup to determine the minimizes number of pointers
5
Rules for Constructing a B+ Tree The number of key values contained in a non-leaf node is 1 less than the number of pointers If the tree has order n, the number of occupied key values in a leaf node must be between (n-1)/2 and n-1. If (n-1)/2 is not an integer, round up to determine the minimum number of occupied key values. The tree must be balanced, that is, every path from the root node must have the same length.
6
Storage Capacity Number of records that can be stored in a B+ tree –n d-1 (n-1) Each node in a tree is a block –How many records if 20 pointers per node and 3 levels?
7
Building a B+ Tree 1 5 16 25 30 60 75 80 100 115 120 145 150 165 200 215 230 240 270 300 The nodes should not be full – 67% (internal) /78% (Leaf)
8
Inserting 5 100 200 15 60 120 150 230 270 1 860 75 80120 145200 215270 300 15 25 30100 115150 165230 240
9
Deleting 80 100 200 15 60 120 150 230 270 1 5 860 75 80120 145200 215270 300 15 25 30100 115150 165230 240
10
Inserting 20 100 200 15 60 120 150 230 270 1 5 860 75120 145200 215270 300 15 25 30100 115150 165230 240
11
Deleting 75 100 200 15 25 60 120 150 230 270 1 5 860 75120 145200 215270 300 25 30 100 115150 165230 240 15 20
12
Final Tree 100 200 15 25 120 150 230 270 1 5 825 30 60120 145200 215270 300 15 20100 115150 165230 240
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.