Question: Consider the query to select some tuples from nat ural join of E1 and E2. The query can be evaluated in two different ways, representing
Consider the query to select some tuples from nat ural join of E1 and E2. The query can be evaluated in two different ways, representing as Figures (a) join then select and (b) select then join. Different algorit hms may be used for the natural join. Let relations E1(A, B, C) and E2(C, D) have the following properties: E1 has 10,000 tuples, r2 has 20,000 tuples, 25 tuples of E1 fit on one block, and 40 tuples of E2 fit on one block. Assume the selection is on attribute B- CS5600", i.e., B:'CS5600" , and there are 100 tuples in E1 satisfying the selection condition. For each of the following scenarios, estimate the number of block transfers and seeks required 1. In the worst case (minimal required memory), (a) join then select, block nested-loop join, pipelining, i.e., pass the intermediate tuples directly to the selection. 2. In the worst case, (b) select then join, file scan for selection, nested-loop join, materialization, i.e., store selected tuples to disk and then read them later for join. In the best case, (b) select then join, file scan for selection, nested-loop join, mat erialization, and discuss the number of pages/blocks of the memory required 3. E2 E1 (a) join then select E1 (b) select then join E2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
