COMP9315 14s2 |
The University of New South Wales COMP9315 DBMS Implementation Final Exam 14s2 |
DBMS Implementation |
Consider a linear hashed file which can hold just 3 tuples in each page (whether a main data page or an overflow page). The file has two parameters: depth, d, indicating that the file was size 2d at the start of the last expansion phase; split pointer, sp, containing the index of the next page to be split. The hash function h() produces the following hash values for keys A .. T.
|
|
|
|
Assume that a split occurs on every 5th insertion (i.e. just before E J O, T are inserted). So, for example, the request insert(E) is received, a split occurs, and then E is inserted.
Start with a file with two empty pages (d = 1 and sp = 0).
Show the state of the file at the following points:
Use the following notation for showing the file contents:
d = 1, sp = 1 [0] k1,k2,k3 -> k4 [1] k5,k6 [2] k7,k8,k9 -> k10,k11
This shows that file has a depth d of 1, the split pointer sp indicates page 1, page [0] contains three tuples in the main data page and one tuple in its overflow page, page [1] contains two tuples, etc. Each ki is the key value for a tuple stored in that page.
Using the above notation, the initial empty state of the file would be shown as:
d = 1, sp = 0 [0] - [1] -
After the insertion of A, B and C, the file would look like:
d = 1, sp = 0 [0] A,C [1] B
Instructions: