b. Use studioName index to fetch rows
The index does not use pointer buckets so each the bucket will contain 10 key-pointer pairs. Since there are 51 Disney movies, they will be spread over 6 blocks. Assuming the worse case that each record is on a different block, we will need to read 51 blocks to get the records themselves. Checking whether the movie was made in 1995 will require no additional I/O once the block containing the record has been read so the total I/O requirement is 57 I/O's.
c. Use year index to fetch rows
The index does not use pointer buckets so each the bucket will contain 10 key-pointer pairs. Since there are 101 movies from 1995, they will be spread over 11 blocks. Assuming the worse case that each record is on a different block, we will need to read 101 blocks to get the records themselves. Checking whether the movie was made by Disney will require no additional I/O once the block containing the record has been read so the total I/O requirement is 112 I/O's.
b. Dense B-Tree on a heap
(i) Each leaf will hold 69 keys so the tree will need 14493 leaf nodes. Each interior node points to 70 children so the tree will need 208 nodes above the leaves. This level will have 3 parent nodes. Finally, the tree will have a root node. The total space for the tree is therefore 14705 blocks.
(ii) To retrieve a record given its search key will require reading the root, two interior nodes and a leaf node. We must then follow the pointer in the leaf to read the block itself. The total number of I/O's is therefore 5.c. Sparse B-Tree on a sequential file
(i) Each leaf will hold 69 keys so the tree will need 1450 leaf nodes. Each interior node points to 70 children so the tree will need 21 nodes above the leaves. Finally, the tree will have a root node. The total space for the tree is therefore 1472 blocks.
(ii) To retrieve a record given its search key will require reading the root, one interior node and a leaf node. We must then follow the pointer in the leaf to read the block itself. The total number of I/O's is therefore 4.
Here is the tree at the three points. Note that record pointers are not shown.
The likelihood of really packing an extensible hash index this tightly is slim. Remember that we pick
some initial directory size and then double it every time we'd need an overflow block. Suppose we started
with a directory with 1024 entries. How large would it be when it was fully populated? It would be
65536 entries large, the smallest power of two that's larger than our minimum value of 46875. This requires
161 blocks. We would likewise have 65536 blocks instead of 46875 blocks for the hash buckets. Our revised
storage total is 65536+161 = 65697 blocks. Note that our occupancy of this index is 46875/65536 = 71.5%
.