CS FundamentalsVery hardGATE CS · Product placement
A file has 120,000 records of 150 bytes, stored unspanned in 4096-byte blocks and ordered on key K. A primary (sparse) index on K has one entry per data block, each entry being a 16-byte key plus a 8-byte block pointer. How many block accesses does a binary search on the INDEX plus one data-block read need, in the worst case?
- A. 6
- B. 5
- C. 11
- D. 13
Correct answer: A. 6
bfr = ⌊4096/150⌋ = 27, so 4,445 data blocks. Index bfr = ⌊4096/24⌋ = 170, so ⌈4445/170⌉ = 27 index blocks; binary search takes ⌈log₂ 27⌉ = 5 accesses, +1 for the data block = 6.
More DBMS and SQL questions
- Employee(eid, name) has a recursive one-to-many relationship 'manages' (a manager manages many employees; each employee has at most one…
- In logical query processing order, which clause of a SELECT statement is evaluated LAST?
- R(A, B, C, D, E, F) has FDs C → AD, EF → C, B → A, AD → E. Each option is a relation schema obtained by projecting R, with the…
- Table Product(pid, cat, price) rows: (1, 'X', 10), (2, 'X', 20), (3, 'Y', 20), (4, NULL, 30), (5, 'Y', NULL), (6, 'Z', 5). What does this…
- A B+ tree has at most 21 children per internal node and at most 20 keys per leaf. A non-root internal node must have at least ⌈21/2⌉…
- R(A, B, C, D, E) with functional dependencies B → A, E → D, D → C is decomposed into R1(A, B), R2(A, C), R3(C, D, E). Which statement is…