CS FundamentalsVery hardGATE CS · DBMS
A file of 5000 blocks is sorted by external merge sort with M = 21 buffer blocks (sorted runs of M blocks are created in pass 0, then (M − 1)-way merges). How many passes in total are needed, and how many block transfers if each pass reads and writes every block once?
- A. 3 passes, 15,000 transfers
- B. 4 passes, 40,000 transfers
- C. 2 passes, 20,000 transfers
- D. 3 passes, 30,000 transfers
Correct answer: D. 3 passes, 30,000 transfers
Pass 0 makes ⌈5000/21⌉ = 239 runs; each merge pass divides the run count by 20, needing 2 merge pass(es). Total 3 passes × 2 × 5000 = 30,000 transfers.
More DBMS and SQL questions
- Table Route(src, dst, cost) rows: ('A', 'B', 5), ('B', 'C', 4), ('A', 'C', 12), ('C', 'D', 3), ('B', 'D', 9), ('D', 'A', 2). What does…
- Table Acct(no, branch, bal) rows: (101, 'Agra', 500), (102, 'Agra', 1500), (103, 'Bhopal', 700), (104, 'Bhopal', 700), (105, 'Cuttack'…
- Which statement about snapshot isolation (SI) is correct?
- R(A, B) has 300 tuples and S(B, C) has 50 tuples, where S.B is the primary key of S and R.B is a foreign key referencing it (NOT NULL)…
- Table P(x) rows: (1), (2), (2), (3), (NULL). Table Q(x) rows: (2), (3), (3), (NULL), (4). What does this query return? sql SELECT COUNT()…
- R has 500 tuples in 50 blocks and S has 4000 tuples in 200 blocks. With only enough memory for one block of each relation, how many block…