Question: This problem will explore different join implementations and the associated IO costs for different models. Let R ( a , b ) , S (
This problem will explore different join implementations and the associated IO costs for different models. Let Ra b Sb c and Tc d be tables. For the purpose of this question, use the values provided below.
PR number of pages of R
TR number of tuples of R
PS number of pages of S
TS number of tuples of S
PT number of pages of T
PR S number of pages in output RS
PS T number of pages in output ST
PR S T number of pages in output RST
B number of buffer pages
a point
Let us start by considering a simple nested loop join. Compute the IO cost for a simple nested loop join if R is the outer loop and S is the inner loop.
b point
Compute the IO cost for a simple nested loop join if S is the outer loop and R is the inner loop.
c points
Now consider using a block nested loop join. Compute the IO cost for joining R S and then joining the result with T Then compute the IO cost for joining S T and then joining the result with R
d points
Now consider using a sortmerge join. Compute the IO cost for joining R S and then joining the result with T Assume that the tables are not sorted before starting. Also assume that we do not need to do any back up as described in lecture.
e points
Again, using a sortmerge join, compute the IO cost for joining S T and then joining
the result with R Assume that the tables are not sorted before starting. Also assume
that we do not need to do any back up as described in lecture.
f points
Now suppose we only want to join R and S with sortmerge join but this time all values for the join attribute are the same. What would be the IO cost now?
g points
Now consider using a hash join. Compute the IO cost for joining R S and then joining the result with T
h points
Again, using a hash join, compute the IO cost for joining S T and then joining the result with R
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
