Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the query: (A,B,C,D)(R(A=C)S) Suppose that the projection routine is based on sorting and is smart enough to eliminate all but the desired attributes during
Consider the query: (A,B,C,D)(R(A=C)S) Suppose that the projection routine is based on sorting and is smart enough to eliminate all but the desired attributes during the initial pass of the sort and also to toss out duplicate tuples on-the-fly while sorting, thereby eliminating two potential extra passes. Finally, assume the following: - R is 10 pages long and R tuples are 50 bytes long. - S is 100 pages long and S tuples are 500 bytes long. - C is a key for S and A is a key for R. - The page size is 1024 bytes. - Each R tuple joins with exactly one S tuple (and vice versa). - The combined size of attributes A,B,C and D is 450 bytes. - A and B are in R and have a combined size of 20 bytes; C and D are in S. Answer each of the following questions: 1. What is the cost of writing out the final result? 2. Suppose that three buffer pages are available and the only join method that is implemented in simple (page-oriented) nested loops. (a) Compute the cost of doing the projection followed by the join. (b) Compute the cost of doing the join followed by the projection. (c) Compute the cost of doing the join first and then the projection on-the-fly. (d) Would your answer change if 11 buffer pages were available? 3. Suppose that there are three buffers available and the only join method that is implemented is block nested loops. (a) Compute the cost of doing the projection followed by the join. (b) Compute the cost of doing the join followed by the projection. (c) Compute the cost of doing the join first and then the projection on-the-fly. (d) Would your answer change if 11 buffer pages were available
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started