Next: Buffer replacement policies
Up: Storage Access
Previous: Storage Access
The subsystem responsible for the allocation of buffer space is called
the buffer manager.
The buffer manager handles all requests for blocks of the database.
If the block is already in main memory,
the address in main memory is given to the requester.
If not, the buffer manager must read the block in from disk (possibly
displacing some other block if the buffer is full) and then pass the
address in main memory to the requester.
The buffer manager must use some sophisticated techniques in order to provide
Replacement Strategy -- When there is no room left in the buffer,
some block must be removed to make way for the new one.
Typical operating system memory management schemes use a ``least recently
used'' (LRU) method.
(Simply remove the block least recently referenced.)
This can be improved upon for database applications.
Pinned Blocks - For the database to be able to recover from crashes,
we need to restrict times when a block maybe written back to disk.
A block not allowed to be written is said to be pinned.
Many operating systems do not provide support for pinned blocks,
and such a feature is essential if a database is to be ``crash resistant''.
Forced Output of Blocks - Sometimes it is necessary to write
a block back to disk even though its buffer space is not needed,
(called the forced output of a block.)
This is due to the fact that main memory contents (and thus the buffer)
are lost in a crash, while disk data usually survives.
Tue Jul 7 16:00:21 PDT 1998