CS FundamentalsModerateGATE CS (PYQ pattern)
R has 100 pages and S has 50 pages. Block nested-loop join uses 12 buffer pages: 10 for a block of the outer relation, 1 for the inner and 1 for output (result not written). What is the minimum I/O cost over the two choices of outer relation?
- A. 600
- B. 5100
- C. 150
- D. 550
Correct answer: D. 550
R outer: 100 + ceil(100/10) x 50 = 600. S outer: 50 + ceil(50/10) x 100 = 550. The smaller relation as outer is cheaper here. 5100 is page-at-a-time nested loops; 150 would need S to fit entirely in memory.
More DBMS and SQL questions
- R(A, B, C, D, E, F) has the functional dependencies D → E, AD → B, D → E, DA → F, EC → D, ED → C. How many of the listed FDs violate BCNF…
- R(A, B, C, D, E) has the functional dependencies D → A, EA → C, D → C, D → E, BC → A. How many attributes appear in the left sides of a…
- R(A, B, C, D, E, F) has the functional dependencies F → B, C → A, BD → C, B → E, C → A, BC → A. How many superkeys does R have?
- R(A, B, C, D, E, F) has the functional dependencies DB → C, F → A, AD → C, F → B, CA → D, C → F. 3NF synthesis (canonical cover, one…
- Table AA(x, y): (1,1), (1,2), (2,2), (2,NULL), (3,NULL), (NULL,3). How many groups does SELECT x FROM AA GROUP BY x HAVING COUNT(y) <…
- QA(a, b): (1,2), (2,3), (3,1), (4,4). How many rows does SELECT FROM QA x JOIN QA y ON x.b = y.a JOIN QA z ON y.b = z.a return?