Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The assignment is to be turned in before Midnight (by 11:59pm) on February 7, 20

ID: 3789709 • Letter: T

Question

The assignment is to be turned in before Midnight (by 11:59pm) on February 7, 2017. You should turn in the solutions to this assignment as a pdf file through the TEACH website. The solutions should be produced using editing software programs, such as LaTeX or Word, otherwise they will not be graded. Consider the natural join of the relation R and S on attribute A. Neither relations have any indexes built on them. Assume that R and S have 40000 and 20000 blocks, respectively. The cost of a join is the number of its block I/Os accesses. Assume that there are 50 buffer blocks available in the main memory. What is the fastest join algorithm to compute the join of R and S? What is the cost of this algorithm? Assume that there are 300 buffer blocks available in the main memory. What is the cost of joining R and S using a sort-merge join? You should use a version of sort-merge algorithm that provides the minimum cost. Assume that there are 202 buffer blocks available in the main memory. What is the cost of joining R and S using a sort-merge join? You should use a version of sort-merge algorithm that provides the minimum cost. Assume that there are 150 buffer blocks available in the main memory. What is the fastest join algorithm to compute the join of R and S? What is the cost of this algorithm? Assume that there are 80000 buffer blocks available in the main memory. What is the fastest join algorithm to compute the join of R and S? What is the cost of this algorithm?

Explanation / Answer

a. The fasted join algorithm is Hash-Join it has cost of 2(M+N)=3*60000=120000

b. for sort-merge gain cost=MlogM+NlogN+(M+N).

for 300 buffer pages, both R and S can be sorted in 2 passes; total join cost: 7500

c. for 202 buffer Cost = 3 x (B(R) + B(S)) =180000

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote