CSCI 305: Introduction to Database Systems

Activities on B+ Tree

You are to complete the following exercises on B+ trees. (Revised based on DBSCB 14.2.8 Exercise 14.2.1 through 14.2.3)

  1. Suppose that the blocks can hold either ten records or 99 keys and 100 pointers. Also assume that the average B+ tree node is 70% full; i.e., it will have 69 keys and 70 pointers. We can use the B+ tree as a part of several different structures. For each structure described below, determine (i) the total number of blocks needed for a 1,000,000-record file, and (ii) the average number of disk I/O operations to retrieve a record given its search key.
    1. The data file is a sequential file, sorted on the search key, with 10 records per block.
    2. The same as (a), but the data file consists of record in no particular order, packed 10 to a block.
  2. Do the same as in (1) in the case that the query is a range query that is matched by 1,000 records.
  3. Suppose pointers are 8 bytes long, the keys are 12 bytes long. How many keys and pointers will a block of 16,384 bytes have?