CS FundamentalsModerateGATE CS (PYQ pattern)
A table has 1,000,000 rows in 10,000 pages. An unclustered B+ tree index of height 3 costs 3 page reads to reach the first matching entry plus one page read per matching row (leaf scanning ignored); a full scan costs 10,000 reads. Up to what selectivity (fraction of rows matched) is the index plan cheaper, approximately?
- A. about 10%
- B. about 0.1%
- C. about 1%
- D. about 100%
Correct answer: C. about 1%
Index cost = 3 + s x 1,000,000 < 10,000 gives s < 0.9997% (about 1%). An unclustered index loses quickly because each match can cost a separate page; 10% would be right only if rows-per-page were ignored (comparing with 100,000).
More DBMS and SQL questions
- A RAID 6 array has 10 disks, each sustaining 200 random I/Os per second. A small read costs 1 disk I/O and a small write costs 6 (read…
- Which of the following tuple-relational-calculus expressions are SAFE (guaranteed to return a finite result for every database)? I. { t |…
- R(A, B) = {(1,a), (1,b), (2,a), (3,c), (4,a), (5,b), (5,c)} and S(B) is EMPTY. Using the standard definition R ÷ S = πA(R) − πA((πA(R) ×…
- An ER design has three strong entity sets, one weak entity set (identified through one of them), one multivalued attribute on a strong…
- Which of the following statements about ARIES recovery are correct? I. It follows write-ahead logging: a log record must reach stable…
- Which of the following statements about two-phase locking variants are correct? I. Basic 2PL guarantees conflict-serializable schedules…