This article is a mirror article of machine translation, please click here to jump to the original article.

View: 20055|Reply: 1

[Tips] SQL Server DBCC DROPCLEANBUFFERS is invalid?

[Copy link]
Posted on 2021-7-13 15:45:20 | | |
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.




Previous:Sql Server Summary of Partitioned Tables
Next:SQL SERVER removes the delete partition function and partition scheme
 Landlord| Posted on 2021-7-13 15:46:02 |
Instructions for using checkpoint in SQL Server

https://blog.csdn.net/tjvictor/article/details/5209604
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com