CS FundamentalsVery hardGATE CS (PYQ pattern)
R occupies 1000 pages with 100 tuples per page. S has a B+ tree index on the join attribute (3 levels, so 3 page reads to reach a leaf entry, plus 1 read for the matching S tuple). Each R tuple matches exactly one S tuple. With R as the outer relation (scanned once) and enough buffer to hold nothing else useful, how many page reads does index nested-loops join need?
- A. 4,000
- B. 301,000
- C. 400,000
- D. 401,000
Correct answer: D. 401,000
Scan R once: 1000 reads. Then each of the 1000 x 100 = 100,000 R tuples probes the index: 3 + 1 = 4 reads. Total = 1000 + 400,000 = 401,000.
More DBMS and SQL questions
- A table has 100,000 rows in 2500 pages, and a predicate selects 3% of the rows, which are spread uniformly at random over the pages. An…
- A heap file stores 1,000,000 fixed-length records of 150 bytes in 8192-byte blocks with no block header; records do not span blocks. How…
- R(A, B, C, D, E, F) has the functional dependencies BC → D, F → D, F → C, C → D, E → C, DC → E. Counting only the listed dependencies, how…
- R(A, B, C, D, E, F) has the functional dependencies B → E, E → D, B → E, EB → A, A → F. Decompose R into BCNF by this procedure: while…
- R(A, B, C, D, E, F) has FDs A → B, B → C, C → A, AD → E, E → F. How many candidate keys does R have?
- A relation R(A, B, C) holds the tuples (1,x,10), (1,x,20), (1,y,10), (1,y,20), (2,x,10), (2,y,20). Which statement is correct?