IT462: Assignment 1 (Due before class on 16 January 2009) 1)

advertisement
IT462: Assignment 1
(Due before class on 16 January 2009)
1) Show the state of the following B+Tree Index, after data entry 7* is deleted.
Root
17
5
2*
3*
13
5*
7*
27
14* 16*
22* 24*
30
27
*
29*
33* 34* 38* 39*
2) Show the state of the following Linear Hashing Index, after data entry r with h(r)
= 14 is inserted.
Level=2, N=4
h
h
3
2
000
00
001
01
010
10
011
11
Next=0
32*44* 36*
9* 25* 5*
14* 18* 10* 30*
31* 35* 7* 11*
3) Suppose you have a file with 10000 pages and you have 10 pages available in the
buffer pool.
a) What is the I/O cost (total number of disk I/Os needed) of sorting the above file using
the general external merge sort algorithm we discussed in class?
b) What is the I/O cost (total number of disk I/Os needed) of sorting the above file
using the general external merge sort algorithm with the “prefetch” optimization we
discussed in class: in the second phase, two buffer pages are used for each run, and 2
pages are used for the output. The second page is used to bring into memory (or write
to disk) pages while the CPU is working on sorting the current pages (this overlaps
the CPU with the disk I/O, so the CPU does not have to wait for a new page when the
current page of a run is completely processed, or the output page is full).
Turn-in (due before class on 16 January 2009)
Electronic:
1. N/A
Hard-copies:
1. The completed assignment coversheet. Your comments will help us improve the
course.
2. A hard copy of the file containing answers to all exercises.
Download