0

In MS SQL Server, does Lazy Writer spend resources to make pages out of the buffer pool after periodically checking free buffer list and marking some clean pages as free? Or free marked clean pages continue to stay in the buffer pool until another page is needed to retrieve from the disk and the latter overwrites the free marked clean page?

1 Answer 1

1

does Lazy Writer spend resources to make pages out of the buffer pool after periodically checking free buffer list and marking some clean pages as free

Yes it does, this is primary responsibility of Lazy writer. Its job is to make sure there is some free buffer so that new pages can be brought into memory when required.

Lazy writer would periodically scan buffer pool, look for pages which are least recently used, or you can say "cold pages" and flush them to disk. In case there is sufficient memory available Lazy writer would not do anything. In case of memory being required to bring more page into buffer pool Lazy writer would flush old pages, create space and bring new pages. It does not marks pages as clean

3
  • Thank you for the answer but it's not what I want. I am interested whether it takes them out or overwrites them.
    – igelr
    Commented Feb 17, 2019 at 11:38
  • By "it" you mean pages right ?. If so, it takes them out
    – Shanky
    Commented Feb 17, 2019 at 17:49
  • Ok, I confused it with a checkpoint process which does not flush pages out from the data cache though makes them 'clean'. Means Lazy Writer, in comparison, makes them out of the data cache after marking them 'clean'. Thanks @Shanky
    – igelr
    Commented Feb 20, 2019 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.