有一个“最佳实践”,你必须运行
DBCC FREESESSIONCACHE DBCC FREEPROCCACHE DBCC DROPCLEANBUFFERS
然而,例如,后来的一个DROPCLEANBUFFERS:
Use DBCC DROPCLEANBUFFERS to test queries with a cold buffer cache
without shutting down and restarting the server.To drop clean buffers from the buffer pool,first use CHECKPOINT to
produce a cold buffer cache. This forces all dirty pages for the
current database to be written to disk and cleans the buffers. After
you do this,you can issue DBCC DROPCLEANBUFFERS command to remove all
buffers from the buffer pool.
解决方法
我不同意这是最好的做法,很少使用它.
我调用的查询应该是受欢迎的,经常运行的.这给了我最大的鼓舞我的钱.对于任何一个计划或数据,都应该很少运行“冷”.
以前曾经在DBA.SE问过.请看这些
> https://dba.stackexchange.com/a/10820/630
> https://dba.stackexchange.com/a/7870/630