Download presentation
Presentation is loading. Please wait.
Published byNeil Kelley Modified over 9 years ago
1
Fan Qi fan.qi@nus.edu.sg Database Lab 1, com1 #01-08 CS3223 Tutorial 4
2
Block I/O Sorting 1 block for output
3
Selection Access: Table Scan Index Scan Index Seek Index Intersection Index Access: B+ Tree : range and equality Hash : equality only Cost B+ Tree Navigation cost Leaf page scan cost RID look up cost Hash Index Chain Cost (Reading Bucket Page into Memory) RID look up cost
4
Question 1
5
Disk 1 1 2 2 … … 320 321 322 … … 640 641 642 … … 960 961 962 … … 1280 Memory in out
6
Question 1
7
Take-away points Block I/O reduces sorting time Diminishing return at some point, why? In practice, read/write block are of the same size SortTime 319-Merge640,000,000ms 256-Merge, 1 in 64 out344,687,500ms 16-Merge, 16 in 64 out126,875,000ms 8-Merge, 32 in 64 out135,156,250ms 4-Merge,64 in 64 out195,500,000ms
8
Question 3 1. Table Scan
9
Disk Question 3 pr 250 pages Rid Look up to get name
10
Question 3 p r 250 pages500 pages Intersect Disk Rid Look up to get name
11
Question 3 Disk p 200 pages Rid Look up to get name for each record
12
Question 4
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.