This problem will explore different join implementations and the associated 10 costs for each model. Let...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
This problem will explore different join implementations and the associated 10 costs for each model. Let R(a, b), S(b, c), and T(c,d) be tables. For the purpose of this question, use the values provided below. • P(R) = number of pages of R = 20 T(R) = number of tuples of R = 1600 P(S) = number of pages of S = 200 • T(S)= number of tuples of S = 15000 • P(T) = number of pages of T = 2000 P(R, S) = number of pages in output RS = 100 • P(S, T) = number of pages in output ST = 1000 • P(R, S, T) = number of pages in output RST = 500 • B= number of buffer pages = 32 Assume that no repacking is being done unless it is specified explicitly. . . . Question 4.1 Let us start by considering a simple nested loop join. Compute the 10 cost for a simple nested loop join if R is the "outer loop" and S is the "inner loop." Question 4.2 Compute the 10 cost for a simple nested loop join if S is the "outer loop" and R is the "inner loop." Question 4.3 Now consider using a block nested loop join. Compute the 10 cost for joining R, S and then joining the result with T. Then compute the 10 cost for joining S, T and then joining the result with R. Question 4.4 Now consider using a sort-merge join. Compute the 10 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. Question 4.5 Again, using a sort-merge join, compute the 10 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. Question 4.6 Now suppose we only want to join R and S (with sort-merge join) but this time all values for the join attribute are the same. What would be the 10 cost now? Question 4.7 Now consider using a hash join. Compute the 10 cost for joining R, S and then joining the result with T. Question 4.8 Again, using a hash join, compute the 10 cost for joining S, T and then joining the result with R. Question 4.9 For the query plan where join1 = R(a,b),S(b,c) and join2 = join1(a,b,c),T(c,d), find a configuration where using hash join for join1 and sort-merge join for join2 is cheaper than sort-merge join for join1 and hash join for join2 by adjusting buffer sizes and the number of pages in each table. Provide your answer in terms of the variables listed at the start of this question (such as P(R), P(R, S), B, etc.). The output sizes you choose for P(R, S) and P(R, S, T) must be non-zero and feasible (e.g. the maximum output size of join 1 is P(R)*P(S)). This problem will explore different join implementations and the associated 10 costs for each model. Let R(a, b), S(b, c), and T(c,d) be tables. For the purpose of this question, use the values provided below. • P(R) = number of pages of R = 20 T(R) = number of tuples of R = 1600 P(S) = number of pages of S = 200 • T(S)= number of tuples of S = 15000 • P(T) = number of pages of T = 2000 P(R, S) = number of pages in output RS = 100 • P(S, T) = number of pages in output ST = 1000 • P(R, S, T) = number of pages in output RST = 500 • B= number of buffer pages = 32 Assume that no repacking is being done unless it is specified explicitly. . . . Question 4.1 Let us start by considering a simple nested loop join. Compute the 10 cost for a simple nested loop join if R is the "outer loop" and S is the "inner loop." Question 4.2 Compute the 10 cost for a simple nested loop join if S is the "outer loop" and R is the "inner loop." Question 4.3 Now consider using a block nested loop join. Compute the 10 cost for joining R, S and then joining the result with T. Then compute the 10 cost for joining S, T and then joining the result with R. Question 4.4 Now consider using a sort-merge join. Compute the 10 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. Question 4.5 Again, using a sort-merge join, compute the 10 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. Question 4.6 Now suppose we only want to join R and S (with sort-merge join) but this time all values for the join attribute are the same. What would be the 10 cost now? Question 4.7 Now consider using a hash join. Compute the 10 cost for joining R, S and then joining the result with T. Question 4.8 Again, using a hash join, compute the 10 cost for joining S, T and then joining the result with R. Question 4.9 For the query plan where join1 = R(a,b),S(b,c) and join2 = join1(a,b,c),T(c,d), find a configuration where using hash join for join1 and sort-merge join for join2 is cheaper than sort-merge join for join1 and hash join for join2 by adjusting buffer sizes and the number of pages in each table. Provide your answer in terms of the variables listed at the start of this question (such as P(R), P(R, S), B, etc.). The output sizes you choose for P(R, S) and P(R, S, T) must be non-zero and feasible (e.g. the maximum output size of join 1 is P(R)*P(S)).
Expert Answer:
Answer rating: 100% (QA)
Based on the provided information lets begin by addressing Question 41 Question 41 asks us to comput... View the full answer
Related Book For
Artificial Intelligence A Modern Approach
ISBN: 9780134610993
4th Edition
Authors: Stuart Russell, Peter Norvig
Posted Date:
Students also viewed these databases questions
-
The challenges involved in managing virtual teams. As a new manager, you are tasked with overseeing a team that has been functioning poorly for over a year. What is one team strategy that you decide...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A common stock pays an annual dividend that increases by 4% annually and sells for $35 per share. If the market rate of return on this stock is 8%. What is the amount of the ?last dividend paid $1.53...
-
If the string that holds a whirling can in its circular path breaks, what kind of force causes it to move in a straight line path: centripetal, centrifugal, or no force? What law of physics supports...
-
The file AirportTraffic contains the number of total passengers and the annual rate of change in passenger traffic for 50 airports. a. Construct a 95% confidence interval estimate for the population...
-
What is your role in your personal financial program?
-
The annual data that follow pertain to Flannery Water Optics, a manufacturer of swimming goggles (the company had no beginning inventories): Sales...
-
Q.2 a&b. What is shareholders' equity in 2018 and 2019? c&d. What is net working capital in 2018 and 2019? e. What are taxes paid in 2019? Assume the firm pays taxes equal to 21% of taxa...
-
A 95% confidence interval for the proportion of viewers of a certain reality television show who are over 30 is (0.26, 0.35). Suppose the show's producers want to test the hypothesis Ho P = 0.25...
-
Describe the elements of secured transactions. Discuss and explain them Briefly. The Parties Types of Collateral The Security Agreement
-
Explain what a challenge for cause and a peremptory challenge are. Provide an example of both. Explain the purpose of a directed verdict, when does it occur and why. Explain the function of the Court...
-
Plaintiff must show evidence that a provider of alcoholic beverages ordered or rewarded over-service, or circumstantial evidence that the provider engaged in behavior which a reasonable provider...
-
Zarqa Manufacturing Company started its business in January 2019 producing and selling only Product (B). The company's cost accounting manager has set the following targets related to Product (B):...
-
The Association for the Humane Treatment of Mental Illness (AHTMI) at Open House University is a recognized campus organization and has requested facility space to bring Norman Maine, an advocate for...
-
Browne-Marshall readings first located in the "weekly materials" folder under "supplemental readings" sub folder. Try to address these questions: 1. What does history reveal about American law? What...
-
a. Explain the reasons why there are differences and/or similarities in your data by relating to the advantages/disadvantages of the testing methodologies
-
Determine by direct integration the values of x for the two volumes obtained by passing a vertical cutting plane through the given shape of Fig. 5.21. The cutting plane is parallel to the base of the...
-
Examine at least three science-fiction movies in which AI systems threaten to (or actually do) take control. In the movie, does the takeover stem from spooky emergent consciousness or from a poorly...
-
You are given a model with two distinct label variables Y 1 , Y 2 , and there is a super label Z which conditions all of these labels, thus giving us this hierarchical nave Bayes model. The...
-
Assume we are running variable elimination, and we currently have the following three factors: The next step in the variable elimination is to eliminate B. a. Which factors will participate in the...
-
How can the location of a home affect insurance costs?
-
Why do some insurance companies offer discounts to drivers who install security devices in their vehicles?
-
Malcolm wants to buy an expensive sportutility vehicle. However, his mechanic has warned him that the replacement parts for the vehicle that he wants are costly. His friend Ishiro is on a tight...
Study smarter with the SolutionInn App