Question: Consider the following query. (The user is trying to read P1 from disk, then read P2, Write P3, ..., commit at the end.) Read

Consider the following query. (The user is trying to read P1 from disk, then read P2, Write P3, ..., commit

Consider the following query. (The user is trying to read P1 from disk, then read P2, Write P3, ..., commit at the end.) Read P1, Read P2, Write P3, Write P4, Write P5, Read P5, Read P2, Read P4, Commit. Every time when reading or writing a page that is not in the buffer pool, the page needs to be fetched from the disk first. Assume that writing a page follows the same rule as reading a page. The only difference is, if a page that has been written in the buffer pool is going to be replaced, then it has to be written to disk before replacement. Each fetch from disk or write to disk is considered as an equal-cost disk access. Assume there are 3 buffers in the buffer pool. 1. Sketch the process of how blocks are replaced in the Least Recently Used (LRU) policv. What is the number of page fault and disk access? Justify your answer. 2. Sketch the process of how blocks are replaced in the Most Recently Used (MRU) policy. What is the number of page fault and disk access? Justify your answer. 3. Between the LRU and MRU policies above, which one performs better in the given query? Justify you answer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To analyze the LRU Least Recently Used and MRU Most Recently Used buffer replacement policies well simulate the process step by step for the given que... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!