Transcript slides

File Processing : Buffer
2015, Spring
Pusan National University
Ki-Joune Li
PNU
STEM
Buffer

Buffer



Temporary memory to transfer a chunk of data
1 buffer : multiple blocks
Page


A piece of buffer (main memory) corresponding with block
Page Replacement when buffer is full
PNU
STEM
Buffer Management : Read
Access
Request
Get Data
Read Request
If in main
memory
Get Data
Main
Memory
If not in main
memory
Load on main memory
and Replacement
Access to Disk
Disk
PNU
STEM
Buffer Management : Write
Access
Request
Write Data
Write Request
If in main
memory
Write Data
Write Data on Disk
Main
Memory
If not in main
memory
Load on main memory
and Replacement
Access to Disk
Disk
PNU
STEM
Buffer Manager : Replacement Policy

LRU




Replace the block least recently used
Most operating system and buffer management
Idea behind LRU – use past pattern of block references as a
predictor of future references
Prediction of future reference

Queries have well-defined access patterns (such as sequential
scans), and a database system can use the information in a
user’s query to predict future references
PNU
STEM
Buffer Manager : Replacement Policy

Pinned block :


Toss-immediate strategy :


memory block that is not allowed to be written back to disk.
frees the space occupied by a block as soon as the final tuple
of that block has been processed
Most recently used (MRU) strategy :

system must pin the block currently being processed. After the
final tuple of that block has been processed, the block is
unpinned, and it becomes the most recently used block.