Question 5 (8 marks)
Duplicate removal in projection can be implemented using either sorting or hashing.
Consider a projection scenario where
- the original tuples are Ro = 40 bytes long
- the projected tuples are Rp = 20 bytes long
- the original file has bo = 200 pages
- the projected file (with duplicates) has bp = 100 pages
- the result file (no duplicates) has br = 80 pages
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.
calculate the total cost of projection using sorting for duplicate removal
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:
- Type your answer to this question into the file called q5.txt
- Submit via: give cs9315 exam_q5 q5.txt
or via: Webcms3 > exams > Final Exam > Q5 submission > Make Submission
End of Question
Duplicate removal in projection can be implemented using either sorting or hashing.
Consider a projection scenario where
- the original tuples are Ro = 40 bytes long
- the projected tuples are Rp = 20 bytes long
- the original file has bo = 200 pages
- the projected file (with duplicates) has bp = 100 pages
- the result file (no duplicates) has br = 80 pages
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.
calculate the total cost of projection using sorting for duplicate removal
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:
- Type your answer to this question into the file called q5.txt
- Submit via: give cs9315 exam_q5 q5.txt
or via: Webcms3 > exams > Final Exam > Q5 submission > Make Submission