COMP9315 21T1 Final Exam The University of New South Wales
COMP9315 DBMS Implementation
21T1 Final Exam
DBMS Implementation
[Instructions] [PostgreSQL] [C]
[Q1] [Q2] [Q3] [Q4] [Q5] [Q6] [Q7] [Q8]

Question 5 (10 marks)

Consider the following relation

create table R (a integer, b char(1));

and a 2-way kd-tree index constructed on this relation

Show, in order of access and starting from node 0, the sequence of index and data pages (red numbers) that will be accessed in answering each of the following queries:

  1. select * from R where a = 20 and b = 'a';
    
  2. select * from R where a = 60;
    
  3. select * from R where b = 'd';
    
  4. select * from R where a < 60 and b > 'f';
    
  5. select * from R where b > 'c';
    

Assume a recursive "node, then left subtree, then right subtree" style traversal.

Note that it is irrelevant whether a query finds any solution; it would find solutions when it examines data pages.

Instructions:

End of Question