Question: 5. Which index or storage type is ideal for the query SELECT C1 FROM R1 WHERE C2 BETWEEN 12 AND 20? You may assume most


5. Which index or storage type is ideal for the query SELECT C1 FROM R1 WHERE C2 BETWEEN 12 AND 20? You may assume most records have values of C2 outside of the range 12-20. (a) Hash index on C2 (b) Clustered B+-tree index on C2 (c) Unclustered B+-tree index on C2 (d) Sorted file on C2 (e) Composite B+-tree index on C1, C2 6. What if all of the records in problem 5 had C2 values between 12 and 20 ? (a) Hash index on C2 (b) Clustered B+-tree index on C2 (c) Unclustered B+-tree index on C2 (d) Sorted file on C2 (e) Composite B+-tree index on C1, C2 7. Consider the SQL query SELECT * FROM R1 WHERE C1=4 AND C2=10 AND C3=11. Suppose R1 has one million records stored in 100 disk pages, C1 has 10,000 unique values, C2 has 100,000 unique values, and C3 has 1,000 unique values, and values are distributed uniformly. Which relational algebra expression leads to the most efficient query execution plan? (a) C1=4(C2=10(C3=11(R1))) (b) C3=11(C1=4(C2=10(R1))) (c) C2=10(C1=4(C3=11(R1))) (d) C3=11(C2=10(C1=4(R1))) (e) all four are equally efficient 8. Does your answer to number 7 change if there is a clustered B+-tree index on C3? (a) C1=4(C2=10(C3=11(R1))) (b) C3=11(C1=4(C2=10(R1))) (c) C2=10(C1=4(C3=11(R1))) (d) C3=11(C2=10(C1=4(R1))) (e) all four are equally efficient 9. The efficiency of the nested-loop algorithm for computing natural or equi-joins can be improved by: (a) using an index on the table scanned by the outer loop to find needed records (b) using an index on the table scanned by the inner loop to find needed records (c) scanning the larger table in the outer loop (d) scanning the smaller table in the outer loop (e) a and c (f) b and d 10. After translating a query into a relational expression, the expression can be optimized by (a) using equivalence rules to find alternative expressions that might cost less (b) using equivalence rules to make the expression tree more balanced (c) using equivalence rules to do the cheaper operations first when possible (d) a and c (e) none of the above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
