Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the join R S where the join predicate is R.a = S.b, given the following metadata about R and S: Relation R contains 20,000

Consider the join R S where the join predicate is R.a = S.b, given the following metadata about R and S:

Relation R contains 20,000 tuples and has 10 tuples per block

Relation S contains 5,000 tuples and has 10 tuples per block

Attribute b of relation S is the primary key for S, and every tuple in S matches 3 tuples in R

There exists a unclustered (secondary) index on R.a with height 3

There exists a clustered (primary) index on S.b with height 2

The main memory buffer can hold 5 blocks (B=5)

Answer the following questions:

a. If R S is evaluated with a block nested loop join, which relation should be the outer relation? Justify your answer. What is the cost of the join in number of I/Os?

b. If R S is evaluated with an index nested loop join, what will be the cost of the join in number of I/Os? Show your cost analysis.

c. What is the cost of a plan that evaluates this query using sort-merge join. Show the details of your cost analysis.

d. Evaluate the cost of computing the R S using hash join assuming: i) The main memory buffer can hold 202 blocks, ii) The main memory buffer can hold 11 blocks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions