Question: Consider the condition join R 1 | > | _ ( R 1 . a = R 2 . b ) R 2 , given
Consider the condition join RRaRbR given the following information
about the relations to be joined. The costmetric is the number of IOs. The cost of
writing the result would be the same independent of the particular join method used,
hence we henceforth can ignore it Given:
R has tuple, tuples per block
R has tuple, tuples per block
The available memory buffers are
Assume we use a blockoriented nested loop join.
a Which relation you suggest to be the outer relation?
b What is the cost of the join if we use the outer relation as you suggested?
c What is the cost of the join if we use the other relation not what you suggestion as the outer one?
Assume we use a sortmerge join, and we use the "Efficient SortMerge" algorithm covered in class where we
merge the sorting and joining together
a What is the cost of the join algorithm?
b What is the minimum number of buffers needed for the cost to remain unchanged, ie Can we use less than
buffers and still have the same cost that you calculated in a
Assume we use a hashjoin, and we will do a simple hashjoin.
a What is the cost of the join algorithm?
b What is the minimum number of buffers needed for the cost of the hash join to remain unchanged, ie Can
we use less than buffers and still have the same cost that you calculated in a
Assume we use an indexjoin with R as the outer relation, and we have an index on Ra Assume that the index fits in memory. Moreover, on average we get R tuples matching every R tuple.
a What is the cost of the join algorithm?
Here you might need to make assumptions ie one or both tables are clustered or not or index is clustered or not, index in memory or not, etc.
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
