CS FundamentalsVery hardGATE CS
A sorted file has 60,000 records of 200 bytes stored unspanned in 4096-byte blocks. A sparse primary index has 20-byte entries (one per data block), stored in 4096-byte blocks and made multilevel until the top level fits in one block. How many block accesses does a lookup need?
- A. 4
- B. 5
- C. 2
- D. 3
Correct answer: D. 3
20 records fit per block, so 3,000 data blocks and 3,000 index entries; 204 entries fit per index block, giving 15 first-level blocks and a 1-block second level. Lookup: 2 index levels + 1 data block = 3.
More DBMS and SQL questions
- R has 2000 tuples and S has 5000 tuples. The join attribute A has 50 distinct values in R and 200 in S. Under the usual uniformity and…
- R(S, C) = {(1, a), (1, b), (2, a), (3, a), (3, b), (3, c), (4, b)}. What is R ÷ πC(σ{S = 1}(R))?
- An ER diagram has entity Employee (key eid, composite attribute name, multivalued attribute phone), weak entity Dependent (partial key…
- A ternary relationship Supplies links Supplier, Part and Project, and the rule is: for a given project and part there is at most one…
- The system crashes after the last record of this log (immediate modification; <Ti, X, old, new>; at the checkpoint all dirty pages were…
- A buffer manager uses NO-STEAL (pages with uncommitted changes are never written to disk) and FORCE (all pages a transaction changed are…