CS FundamentalsVery hardGATE CS · Product placement
A file has 30,000 records of 120 bytes, stored unspanned in 1024-byte blocks and ordered on key K. A primary (sparse) index on K has one entry per data block, each entry being a 9-byte key plus a 7-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. 12
- B. 7
- C. 10
- D. 6
Correct answer: B. 7
bfr = ⌊1024/120⌋ = 8, so 3,750 data blocks. Index bfr = ⌊1024/16⌋ = 64, so ⌈3750/64⌉ = 59 index blocks; binary search takes ⌈log₂ 59⌉ = 6 accesses, +1 for the data block = 7.
More DBMS and SQL questions
- Classify the schedule R3(B), W1(A), R3(A), W1(B), W2(B), R2(B), C2, W3(B), R1(A), C3, C1 (Ci = commit of Ti) by the strongest property it…
- An ER diagram has entity sets E1, E2, E3. R1 relates E1 and E2 many-to-many. R2 relates E2 and E3 one-to-many (each E3 entity relates to…
- Table Att(emp, day, status) rows: ('u', 1, 'P'), ('u', 2, 'P'), ('u', 3, 'A'), ('u', 4, 'P'), ('u', 5, 'P'), ('u', 6, 'P'), ('v', 1, 'A')…
- 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…
- Classify the schedule W3(B), R2(A), R3(B), W2(A), W1(B), R1(B).
- In a B+ tree every internal node can have at most 34 children and every leaf can hold at most 30 keys. With exactly 4 levels (root at…