Hi, I'm new to this forum, I'm currently taking an Into to Database Management course in my university and I need some help with my assignment questions. I've been googling but I can't find anything useful to help me answering some questions.

This assignment is all about database design & concept, it's all very theoritical and I'm having hard time getting my head around it, so let me just start it off
Database <---> Buffer Manager <---> Buffer Pool

the Buffer Manager maintains pin_count and dirty bit

a)
Why do we have pin_count instead of simply pin_flag ?
where:
pin_flag = false if pin_count = 0 and
pin_flag = true if pin_count > 0


I read from textbook that The number of times that the page currently in a given frame has beenrequested but not released -the number of current users of the page- is recorded in the pin_count variable for that frame.


b)

Consider these 2 buffer replacement policies:
1. Evicts a random buffer page chosen from only those frames whose dirty bits are set and pin_count = 0

2. Evicts a random buffer page chosen from only those frames whose dirty bits are NOT set and pin_count = 0

Under what circumstances (if any) strategy #1 is more efficient than #2 ?
Under what circumstances (if any) strategy #2 is more efficient than #1 ?

Thanx for the help guyz