Buffer Replacement Policy
- Frame is chosen for replacement by a replacement policy
- Ideas: choose frame that least likely will be used in future, e.g., FIFO, least-recently-used(LRU), most-recently-used(MRU), etc.
- Policy can have impact on # of I/O's; depends on access pattern
- Sequential flooding: Nasty situation caused by LRU + repeated sequential scans when # frames < # pages in file.
Worst case. should buffer out when read page.
DBMS vs. OS File System
OS does disk space & buffer mgmt too: why not let OS manage these tasks?
- DBMS wants to support multiple OS platforms
- OS files can't span disks
- DBMS requires to
- pin a page in buffer pool, force a page to disk (for implementing CC & recovery)
- adjust replacement policy and pre-fetch pages based on access patterns
How to store fields, records, pages, and files?
Page Formats: Fixed Length Records
왼쪽의 경우에 한 record를 삭제할 경우, 다 밀려 올라간다. 따라서 rid도 바뀐다. 비효율적이다.
오른쪽의 경우에는 비트맵으로 빈 슬롯인지 아닌지 관리한다. 이 경우 rid가 바뀌지 않는다.