CS FundamentalsVery hardGATE CS
A file of 32,000 pages is sorted with an external merge sort using 32 buffer pages: pass 0 produces sorted runs of 32 pages, and every merge pass merges as many runs as possible (one buffer page is kept for output). Counting a read plus a write of every page in every pass (including pass 0), how many page I/Os are performed in total?
- A. 192,000
- B. 320,000
- C. 128,000
- D. 256,000
Correct answer: D. 256,000
Pass 0 yields 1000 runs. With 32 buffers the merge fan-in is 31, so the runs shrink 1000 -> 33 -> 2 -> 1: 3 merge passes. Total passes = 1 + 3 = 4 and I/Os = 2 x 32,000 x 4 = 256,000. A fan-in of 32 would give only 3 passes in all.
More DBMS and SQL questions
- ARIES log: LSN1 T1 update P1; LSN2 T2 update P2; LSN3 T1 update P3; LSN4 begincheckpoint; LSN5 endcheckpoint with active transactions {T1…
- Sa(m, amt) holds monthly sales (2024-01, 100), (2024-02, 130), (2024-03, 130), (2024-04, 90), (2024-05, 150), (2024-06, 150), (2024-07…
- Table T(x) holds the values 1, NULL, 3, NULL, 3. What does SELECT COUNT(), COUNT(x), COUNT(DISTINCT x) FROM T return?
- Emp(n, dept, sal) has rows (A, d1, 40), (B, d1, 70), (C, d2, 45), (D, d2, 50), (E, d3, 80), (F, d3, 30), (G, d4, 60). How many rows does…
- Dept(d) has rows 1, 2, 3 and Emp(e, d) has rows (a, 1), (b, 1), (c, 2). How many rows does SELECT D.d FROM Dept D LEFT JOIN Emp E ON D.d =…
- R(A, B, C, D) has the functional dependencies AB -> C, C -> D and D -> A. How many candidate keys does R have?