Software layer responsible for bringing pages from disk to main memory and back.
The buffer manager partitions the available memory into pages known as buffer pool.
The pages are known as frames
If there is a request for data and the block is already in the buffer, buffer manager returns the address of the block in main memory
If the block is not in the buffer, the buffer manager allocates space in the buffer for the block
Two variables for each frame are used : pin_count : the number of times that the page currently in a given frame has been requested but not released
dirty : Boolean variable indicating whether the page has been modified since it was brought into the buffer pool
When a page is requested the buffer manager : Checks the buffer pool to see if some frame contains the requested page and, if so, increments the pin_count (also called Pinning) of that frame.
If the page is not in the pool, the buffer manager brings it in as follows :
Chooses a frame for replacement, using the replacement policy, and increments its pin_count.
- If the dirty bit for the replacement frame is on, writes the page it contains to disk
Reads the requested page into the repla frame.
Returns the address of the frame contair requested page to the requestor.
Most of the systems replace the block least recently used (LRU strategy) : use past pattern of block references as a predictor of future references
Clock replacement is another variant of LRU with less over head
Both policies are not good for sequential scans
Most Recently Used (MRU)
Buffer manager can use statistical information regarding the probability that a request will reference a particular relation
Buffer managers also support forced output of blocks for the purpose of recovery