蒙混过关有个叫冷青的人面见开封知.ppt

  1. 1、本文档共11页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
蒙混过关有个叫冷青的人面见开封知

Buffer management Buffer Management in a DBMS Data must be in RAM for DBMS to operate on it! Buffer Mgr hides the fact that not all data is in RAM When a Page is Requested ... Buffer pool information table contains: frame#, pageid, pin_count, dirty If requested page is not in pool: Choose a frame for replacement. Only “un-pinned” pages are candidates! If frame is “dirty”, write it to disk Read requested page into chosen frame Pin the page and return its address. More on Buffer Management Requestor of page must eventually unpin it, and indicate whether page has been modified: dirty bit is used for this. Page in pool may be requested many times, a pin count is used. To pin a page, pin_count++ A page is a candidate for replacement iff pin count == 0 (“unpinned”) CC recovery may entail additional I/O when a frame is chosen for replacement. Write-Ahead Log protocol; more later! Buffer Replacement Policy Frame is chosen for replacement by a replacement policy: Least-recently-used (LRU) Most-recently-used (MRU) Also called toss-immediate Clock Policy can have big impact on # of I/O’s; depends on the access pattern. LRU Replacement Policy Least Recently Used (LRU) for each page in buffer pool, keep track of time when last unpinned replace the frame which has the oldest (earliest) time very common policy: intuitive and simple Works well for repeated accesses to popular pages Problems? Problem: Sequential flooding LRU + repeated sequential scans. # buffer frames # pages in file means each page request causes an I/O. Idea: MRU better in this scenario? We’ll see in HW1! “Clock” Replacement Policy An approximation of LRU Instead of maintaining sorting time-stamps, find a ‘reasonably old’ frame to evict. How? by round-robin, and marking each frame - frames are evicted the second time they are visited. Arrange frames into a cycle, store one reference bit per frame , Can think of this as the 2nd chance bit W

文档评论(0)

shuwkb + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档