4 MARKS
Sample Solutions for Quiz 4, Question 7, Hash Join
Version 1: Student has 350,000 records @ 35 records/page; Teacher has 15,000 records @ 60 records/page. B = 20.
a) [2 marks]
Errors?
i. Don’t deduct for missing ceilings.
ii. -1 once only for this whole HJ question if they used some other
buffer size besides B = 20
iii. But -0.5 once only if they used 20 partitions instead of B – 1 = 19
0.5 marks: Student table: ceiling(350,000 rec / 35 rec/page) = 10,000 pages
0.5 marks: Teacher table: ceiling(15,000 rec / 60 rec/page) = 250 pages
0.5 marks: Student partition has ceiling(10,000 pages / 19 partitions) =
527 pages/partition.
i. Deduct 0.5 once if they used 20 partitions instead of 19.
0.5 marks: Teacher partition has ceiling(250 pages / 19 partitions) = 14
pages/partition).
b) [1 mark] iv – neither of the relations needs to be partitioned again
If they messed up Part (a), then see if the rest of their work would be correct, unless it trivializes the solution.
c) [1 mark] 10,000 + 250 = 10,250 page I/Os
OK if they assumed the whole HJ @ 3 * (10,000 + 250)
OK if they said another (10,000 + 250) to write it out (but we don’t
because this is the end of the line)
Don’t double-deduct for errors that propagate, except in the case of a
trivialized solution.
Version 2: Student has 450,000 records @ 45 records/page; Teacher has 30,000 records @ 60 records/page. B = 25.
a) [2 marks]
Errors?
i. Don’t deduct for missing ceilings.
ii. -1 once only for this whole HJ question if they used some other
buffer size besides B = 25
iii. But -0.5 once only if they used 25 partitions instead of B – 1 = 24
0.5 marks: Student table: ceiling(450,000 rec / 45 rec/page) = 10,000 pages
0.5 marks: Teacher table: ceiling(30,000 rec / 60 rec/page) = 500 pages
1
0.5 marks: Student partition has ceiling(10,000 pages / 24 partitions) = 417 pages/partition.
0.5 marks: Teacher partition has ceiling(500 pages / 24 partitions) = 21 pages/partition).
b) [1 mark] iv – neither of the relations needs to be partitioned again
If they messed up Part (a), then see if the rest of their work would be
correct, unless it trivializes the solution. c) [1 mark] 10,000 + 500 = 10,500 page I/Os
OK if they assumed the whole HJ @ 3 * (10,000 + 500)
OK if they said another (10,000 + 500) to write it out (but we don’t
because this is the end of the line)
Don’t double-deduct for errors that propagate, except in the case of a
trivialized solution.
Version 3: Student has 750,000 records @ 75 records/page; Teacher has 40,000 records @ 80 records/page. B = 35.
a) [2 marks]
Errors:
i. Don’t deduct for missing ceilings.
ii. -1 once only for this whole HJ question if they used some other
buffer size besides B = 35
iii. But -0.5 once only if they used 35 partitions instead of B – 1 = 34
0.5 marks: Student table: ceiling(750,000 rec / 75 rec/page) = 10,000 pages
0.5 marks: Teacher table: ceiling(40,000 rec / 80 rec/page) = 500 pages
0.5 marks: Student partition has ceiling(10,000 pages / 34 partitions) =
295 pages/partition.
0.5 marks: Teacher partition has ceiling(500 pages / 34 partitions) = 15
pages/partition).
b) [1 mark] iv – neither of the relations needs to be partitioned again
If they messed up (a), then see if the rest of their work would be correct, unless it trivializes the solution.
c) [1 mark] 10,000 + 500 = 10,500 page I/Os
OK if they assumed the whole HJ @ 3 * (10,000 + 500)
OK if they said another (10,000 + 500) to write it out (but we don’t
because this is the end of the line)
Don’t double-deduct for errors that propagate, except in the case of a
trivialized solution.
2