A database has a buffer pool with space for exactly two pages. It starts empty. When a requested page is absent, the database reads that page from disk, including when the request is an update. There is no prefetching or other cache.
If both spaces are occupied, evict the least recently used page before loading the requested page. Both reading and updating a page make it the most recently used page.
A dirty page is a cached page modified since its last disk write. An update changes only the cached copy and marks it dirty. Evicting a dirty page causes one full-page disk write; evicting a clean page causes none. No other writes occur during the requests. After all requests, write each remaining dirty page to disk once.
Process these requests in order:
Request
Operation
Page
1
Read
4
2
Update
7
3
9
5
6
12
8
Find the number of page reads from disk, page writes caused by evictions, and page writes during the final flush. Give each as an exact integer count.
Unlock full course notes by signing up
Compare two record formats
An equipment register contains 970 records and uses 1,024-byte pages with 64 bytes of fixed overhead per page. Two alternative record formats occupy 56 bytes or 76 bytes per record, including record headers. Both formats also require a separate 4-byte slot entry per record. Records cannot span pages, and each page is filled to capacity before another is used. Complete the table with exact whole numbers for records per page and pages required, excluding index storage.
Grouped and scattered matches
A database retrieves 24 matching equipment records through an index. In either layout, retrieval reads two distinct internal index pages and three distinct leaf index pages, which contain the entries locating the matches. Every matching record must then be fetched from the table.
In Layout A, exactly eight matches occupy each of three table pages. In Layout B, every match occupies a different table page. Both retrievals start with empty caches, retain every page read, and read no additional pages. What is the total number of storage page reads for each layout, including index and table pages? Give each answer as an exact whole number of page reads.
Locate records across page boundaries
An archive stores exported database records in a file. A byte offset is a byte's position measured from the beginning of the file, starting at zero.
Each file page contains exactly 4096 bytes of data, with no headers or padding. Pages are numbered from zero, and positions within each page run from 0 to 4095. Each record occupies 96 consecutive bytes and may cross a page boundary.
For each record below, enter its starting page number, its starting offset within that page in bytes, and the number of distinct pages containing any of its bytes. Give exact integers.
What page counts establish
An audit retrieval can use either a full scan of 1,200 table pages or an index path requiring three distinct index pages and 360 distinct table pages. Each required page is accessed once, and no other pages are needed. Compare an empty-cache state with a state where exactly 300 of the required table pages are cached but all index pages are uncached. Assume no other cache supplies pages. Which statements are supported? Select all that apply.