Question: Consider the join R { R . a = S . b } S , given the following information about R and S . The

Consider the join R {R.a = S.b} S, given the following information about R and S. The cost metric is the number of page I/Os, and the cost of writing out the final result is ignored.
R contains 10,000 tuples and has 10 tuple per page.
S contains 2,000 tuples and also has 10 tuples per page.
S.b is the primary key for S.
Both relations are stored as heap files.
No index
52 pages available in the buffer pool.
What is the cost of the join using a page-oriented nested loop joins (that is, to use one page to load outer relation in each iteration)?
What is the cost of the join using a block nested loop joins?
What is the cost of the join using a sort-merge join?
What is the cost of the join using a hash join?
What would be the lowest possible I/O cost for the join using any join algorithm?
To achieve that lowest possible cost, what is the minimum numbre of buffer pages needed ?
If you are told that R.a is a foreign key that refers to S.b, can this fact be possibly used to reduce the cost of any join algorithms among nest-loop, sort-merge, and hash?
(Choose one from nested-loop, sort-merge, and hash and put in the blank.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!