There’s cool mechanism that that the buffer pool has called disfavoring, that sometimes kicks in to prevent pages from a different database being flushed from the buffer pool when a large operation occurs. When a buffer is no longer required, the buffer can be marked as the least recently used of all the buffers in the buffer pool, meaning that it will used next when the buffer pool needs a new buffer to read a page from disk. This means that a small number of buffers will be used repeatedly instead of filling the buffer pool with pages from the database being consistency checked.
The places that disfavor buffers when they’re done with them include:
- During redo of log records, if a page already has a log record’s effects on it and so doesn’t need to be changed
- During bulk load into a heap
- Large table scans that are more than 10% of the buffer pool size will disfavor pages instead of forcing pages from other databases to be flushed from memory
And backups don’t use the buffer pool at all so they’re not going to cause buffer pool flushing either.
You can watch disfavoring happening for table scans using the leaf_page_disfavored Extended Event.
PS It can look like DBCC CHECKDB isn’t using any pages in the buffer pool but it does, via its hidden snapshot, but then it removes them all once the hidden snapshot is removed.