1 / 6

CS222P: Principles of Data Management Lecture #3 Buffer Manager , PAX

CS222P: Principles of Data Management Lecture #3 Buffer Manager , PAX. Instructor: Chen Li. DB. Next topic: Buffer Management. Page Requests from Higher Levels. Note: Project 1 ’ s PagedFileManager class would do the buffering inside if we were doing it…!.

johndparker
Download Presentation

CS222P: Principles of Data Management Lecture #3 Buffer Manager , PAX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS222P: Principles of Data ManagementLecture #3Buffer Manager,PAX Instructor: Chen Li

  2. DB Next topic: Buffer Management Page Requests from Higher Levels Note: Project 1’s PagedFileManager class would do the buffering inside if we were doing it…! • Data must be in RAM for DBMS to operate on it! • Table of <frame#, pageid> pairs is maintained. BUFFER POOL disk page free frame MAIN MEMORY DISK choice of frame dictated by replacement policy

  3. When a Page is Requested ... • If requested page is not in pool: • Choose a frame for replacement • If that frame is dirty, write it to disk • Read requested page into chosen frame • Pin the page and return its address * If requests can be predicted (e.g., sequential scans) pages can be prefetchedseveral pages at a time!

  4. More on Buffer Management • Requestor of page must unpin it, and indicate whether page has been modified, when done: • dirtybit used for the latter purpose • Page in pool may be requested many times • a pin count is used, and a page is a candidate for replacement iffpin count = 0. • CC & recovery may entail additional I/O when a frame is chosen for replacement. (Write-Ahead Log protocol; more in CS 223.)

  5. Buffer Replacement Policy • Frame is chosen for replacement using a replacement policy: • Least-recently-used (LRU), Clock, MRU, etc. • Policy can have big impact on # of I/O’s; depends on the access pattern. • Sequential flooding: Nasty situation caused by LRU + (repeated) sequential scans. • # buffer frames < # pages in file means each page request causes an I/O. MRU much better in this situation (but not in all situations, of course).

  6. PAX format Traditional Format PAX Format • PAX partitions each page into minipages based on fields • Good caching behaviors for “select fields from …”; • Compression • www.pdl.cmu.edu/PDL-FTP/Database/pax.pdf • Column store (e.g., Vertica)

More Related