Question
Consider a file containing 200 million (i.e., 200 10 6 ) song reviews: revid (8 bytes), sname (40 bytes), rating (2 bytes), comments (40 bytes).
Consider a file containing 200 million (i.e., 200 106) song reviews: revid (8 bytes), sname (40 bytes), rating (2 bytes), comments (40 bytes). Suppose it is stored unsplit on a disk which features the following average times: seek = 7 ms, rotational delay = 8 ms. In addition, the time to read/write a page = 0.5 ms. Page size is 4K (4 210 bytes). You have an available memory (i.e., buffer pool) of 20M (20 220 bytes) for (a)(c).
(a) What is the elapsed time for phase 1 (sort phase)?
(b) How many merge passes are needed in phase 2 if you decide to merge as many SSLs as possible at a time?
(c) What is the elapsed time for the merge phase? Make sure to allocate the pages to the various buffers so as to optimize random accesses. Show the allocation details for every pass. Develop your work carefully, showing the # random accesses and # sequential accesses, before converting to elapsed time.
(d) What is the smallest buffer pool which will let you sort the above file while minimizing the # passes in phase 2? Express your answer in # pages and in # bytes. Show your work.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started