50 likes | 160 Views
Query Processing: The Basics. Chapter 10 (animations). Merge: An Example. Input runs. Output run. 2 3. 5 6. 2. 5. 3. 6. 10. 6. 3. 1. 5. 2. 7. 15. 1 2. 3 5. 6 7. 10 15. 1 7. 10 15. 10. 1. 15. 7. Input buffers. Output buffer.
E N D
Query Processing: The Basics Chapter 10 (animations)
Merge: An Example Input runs Output run 2 3 5 6 2 5 3 6 10 6 3 1 5 2 7 15 1 2 3 5 6 7 10 15 1 7 10 15 10 1 15 7 Input buffers Output buffer
Duplicate elimination During Merge Input runs Last key used Output run 2 3 5 6 5 2 3 6 15 6 5 1 2 3 6 3 1 2 5 15 1 2 3 5 6 15 1 3 5 15 1 5 15 3 Key 3 ignored: duplicate Key 5 ignored: duplicate Input buffers Output buffer
Block-Nested Loop Illustrated Input buffer forr r rs s … and so on Input buffer fors Output buffer
Join During Merge Illustrated r D A 1 3 p p 0 9 q q 8 7 3 s s s 5 7 u u 1 1 v v 1 3 1 3 p p p p p p p p 4 0 0 4 8 7 3 s s s s s s 7 7 7 5 7 5 7 5 7 u u u u u u u u u u u u 2 2 5 5 0 0 B E p p 4 0 r 9 s 7 t t 2 5 u u u 2 5 0 x 0 rA=Bs s