BCC DROPCLEANBUFFERS is used to clear the data cache in memory, and generally when we do performance tuning, we will execute DBCC DROP CLEANBUFFERS before the statement is executed in order to facilitate the execution time and physical IO consumption of a statement.
However, this trick is not always very effective.
Some people may have encountered this phenomenon,Even if DBCC DROPCLEANBUFFERS are executed, there is still no physical read in the output information of SSMS, and this statement is still the data read from memory (logical read)。
You will be surprised, "Isn't the buffer in memory emptied, why is there no physical reading?" Is this phenomenon invalid DBCC DROPCLEANBUFFERS? ”
No. DROP CLEANBUFFERS can indeed be used to clear the data cache in memory, but only the cache pages in the clean state, on the other hand, if these pages are dirty pages, that is, data pages in memory that have been modified and have not been synchronized to disk, then it cannot be cleared from the cache, this is for performance reasons.
So when you encounter DROP CLEANBUFFERS "invalid", try manually synchronizing the data pages in memory and disk, performing:
You can also check the number and size of clean pages and dirty pages in the current memory by saying the following:
Clean cache command:
Original:The hyperlink login is visible. |