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
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
-
Thank you for the answer but it's not what I want. I am interested whether it takes them out or overwrites them.– igelrCommented Feb 17, 2019 at 11:38
-
-
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– igelrCommented Feb 20, 2019 at 8:22