In my development environment, I am playing around with queries. For that I need to reset SQL Server memory, plans, etc. things which can ensure me that my query is the only stress/working process on server with all values reset
Few of the things which I am doing
- Firing checkpoint
- DBCC DROPCLEANBUFFERS;
- DBCC FREEPROCCACHE;
- DBCC FLUSHPROCINDB
- DBCC FREESESSIONCACHE
- DBCC SQLPERF("sys.dm_os_wait_stats",CLEAR);
Am I doing it correctly? or do I need more things to clear or see fresh statistics?
Best Answer
Short of restarting the SQL Server service or the box this is enough. If you want to be absolutely fresh you might want to drop user created statistics from your last run.