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

Question 5 (8 marks)

Duplicate removal in projection can be implemented using either sorting or hashing.

Consider a projection scenario where

Assume that we have a buffer pool with B = 31 buffers available for exclusive use of the projection operation. Assume also that the hash function distributes tuples evenly, and that the total number of pages in the hash partitions is the same as bp.

  1.   calculate the total cost of projection using sorting for duplicate removal

  2.   calculate the total cost of projection using hashing for duplicate removal

Costs are in terms of total page read/writes. Include the cost of reading the original file and the cost of writing the result file.

State all assumptions. Show all working.

Instructions:

End of Question