Waves of misery after index creation
Nikolaus Glombiewski1, Bernhard Seeger1, Goetz Graefe2
1University of Marburg 2Google Inc.
1
after index creation Nikolaus Glombiewski 1 , Bernhard Seeger 1 , - - PowerPoint PPT Presentation
Waves of misery after index creation Nikolaus Glombiewski 1 , Bernhard Seeger 1 , Goetz Graefe 2 1 University of Marburg 2 Google Inc. 1 Outline Problem Assessment Basic Solution Ideal Solution Practical Remedies Experimental
Nikolaus Glombiewski1, Bernhard Seeger1, Goetz Graefe2
1University of Marburg 2Google Inc.
1
2
3
➔ Best supported by bulk loading a perfect secondary b-tree
4
1, 5, 8, 15, 17, 19, 41, 50, 90, 100, 120, 142 1, 5, 8 Building B-Tree Max Nodesize = 3 15, 17, 19 100, 120, 142 41, 50, 90 15, 41, 100 Sort
5
1, 5, 8 15, 17, 19 100, 120, 142 41, 50, 90 15, 41, 100 Max Nodesize = 3 Insert Batch 4, 10, 22, 60, 102, 150
6
1, 4, 5, 8, 10 14, 17, 19, 22 100, 102, 120, 142, 150 41, 50, 60, 90 15, 41, 100 Node Split Node Split Node Split Node Split Max Nodesize = 3
=> Immediate, widespread node splits after index creation
Insert Batch 4, 10, 22, 60, 102, 150
7
100% 50% 50% Split
8
1, 5, 8, 15, 17, 19, 41, 50, 90, 100, 120, 142 1, 5 Building B-Tree Max Nodesize = 3, Utilization = 70% 17, 19 120, 142 90, 100 8, 17, 41, 90, 120 Sort 8, 15 41, 50
9
1, 5 17, 19 120, 142 90, 100 8, 17, 41, 90, 120 8, 15 41, 50 4, 10, 22, 60, 102, 150 Max Nodesize = 3 Insert Batch
10
1, 4, 5 17, 19, 22 120, 142, 150 90, 100, 102 8, 17, 41, 90, 120 8, 10, 14 41, 50, 60 Max Nodesize = 3 Insert Batch 4, 10, 22, 60, 102, 150
10
1, 4, 5 17, 19, 22 120, 142, 150 90, 100, 102 8, 17, 41, 90, 120 8, 10, 14 41, 50, 60 Max Nodesize = 3 Insert Batch 6, 13, 38, 55, 95, 136
12
1, 4, 5, 6 17, 19, 22, 38 120, 136, 142, 150 90, 95, 100, 102 8, 17, 41, 90, 120 8, 10, 13, 14 41, 50, 55, 60 Max Nodesize = 3 Insert Batch 6, 13, 38, 55, 95, 136 Node Split
=> Delayed, widespread node splits after index creation
Node Split Node Split Node Split Node Split Node Split
11
12
13
14
90% 60% 95% Data 50% 70% Bulk Loading
15
90% 60% 95% 50% 70% Insert Batch Node Split Node Split
16
=> Distributing node splits over time
17
Moving hills into valleys
18
B/2 B B/2 1 Item B-5
qB
19
Ԧ 𝑟 𝑜 ∗ 𝐽 +
1 𝑜+1 𝑈
= Ԧ 𝑟 𝑜 + 1
𝑟 𝑜 = Ԧ 𝑟 𝑜 + 𝑙 => A stable state
20
𝑟 𝑜 = Ԧ 𝑟 𝑜 + 𝑙 => A stable state
21
22
23
80% 80%+x 80%-y nextPage()
24
"catchphrase" 100% 80% nextPage() "catchweight" "cattle" ...
25
26
27
28
29
30
Don't just leave constant free space in your tree nodes! Work towards starting in the steady state of the b-tree.
31
32