CS FundamentalsHardGATE CS
A file of 12,000 blocks is sorted by external merge sort with 25 buffer blocks: the run-creation pass makes runs of 25 blocks, and each merge pass merges up to 24 runs. Counting both reads and writes in every pass (including writing the final output), how many block transfers are needed?
- A. 48,000
- B. 72,000
- C. 96,000
- D. 60,000
Correct answer: B. 72,000
Run creation makes ⌈12000 / 25⌉ = 480 runs. Merging with fan-in 24 needs 2 passes (24² = 576 ≥ 480), so 3 passes in all, each reading and writing every block: 3 × 2 × 12,000 = 72,000.
More DBMS and SQL questions
- Relations R (800 blocks) and S (300 blocks) are joined by block nested-loop join with 52 buffer blocks (one for output, one for the inner…
- R has 10,000 tuples in 500 blocks and is the outer relation of an indexed nested-loop join with S. S has a B+ tree on the join attribute…
- 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…
- 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…