cs186_fa07_mt1_sol 8 - containing RID .-If there are...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
4. Buffer Management and Spatial Indexing Suppose the fol owing sequence of cal s is presented to the Buffer Manager of a database: 1. get(1); 2. get(7); 3. pin(7); 4. get(3); 5. pin(3); 6. get(4); 7. get(5); 8. get(1); 9. get(4); 10. unpin(7); 11. get(3); 12. get(6); 13. pin(6); 14. get(2); 15. get(1); 16. get(1); 17. unpin(3); 18. get(2); 19. get(6); 20. get(2); 21. get(7); The cal s above have the fol owing behavior: - get(RID) : fetches the record identified by RID from the buffer, potential y retrieving it from disk as wel if it is not already in the buffer. - pin(RID) : ensures that the record RID stays in the buffer. - unpin(RID) : permits the record RID to be evicted from the buffer. Additional y, assume the fol owing: - The Buffer Manager has 4 buffers A, B, C and D and they are al initial y empty. - The cal s pin(RID) and unpin(RID) cause the Buffer Manager to access the buffer
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: containing RID .-If there are multiple free buffers for Buffer Manager to choose to assign to an RID , Buffer Manager chooses the first free buffer alphabetical y (for example, A before B if both are free). For each of LRU, MRU and CLOCK, please indicate the final buffer contents and the number of buffer misses that occur in the table provided below: Final buffer contents (RIDs) # of buffer misses LRU A B C D 2 7 3 6 11 MRU A B C D 1 6 7 5 11 CLOCK A B C D 1 or 7 7 or 1 3 6 11 1 point for each of the boxes A,B,C,D. 2 points for each correct no. buffer misses. 2 points free. Note that CLOCK has two possible correct entries for A,B depending upon how clock hand is moved. Name_________________________________________- 8 -...
View Full Document

Ask a homework question - tutors are online