CS W186 Introduction to Database Systems
Spring 2020 Josh Hug, Michael Ball DIS 4
1 Buffer Management
(a) Fill in the following tables for the given buffer replacement policies. You have 4 buffer pages, with the access pattern A B C D A F A D G D G E D F
CS W186, Spring 2020, DIS 4 1
(b) Fill in the following tables for the given buffer replacement policies. You have 4 buffer pages, with the access pattern A, B, C, D, A, F (remains pinned), D, G, D, unpin F, G, E, D, F Remember that unpinning does not contribute to the hit count!
(c) Is MRU ever better than LRU?
(d) Why would we use a clock replacement policy over LRU?
(e) Why would it be useful for a database management system to implement its own buffer re- placement policy? Why shouldn¡¯t we just rely on the operating system?
CS W186, Spring 2020, DIS 4 2
2 Relational Algebra
Consider the schema:
Write relational algebra expressions for the following queries:
(a) Find the name of the artists who have albums with a genre of either ¡¯pop¡¯ or ¡¯rock¡¯.
(b) Find the name of the artists who have albums of genre ¡¯pop¡¯ and ¡¯rock¡¯.
(c) Find the id of the artists who have albums of genre ¡¯pop¡¯ or have spent over 10 weeks in the top 40.
(d) Find the names of all artists who do not have any albums.
CS W186, Spring 2020, DIS 4 3