Sample Header Ad - 728x90

SQL Server commands to clear caches before running a performance comparison

51 votes
4 answers
147156 views
When comparing the execution time of two different queries, it's important to clear the cache to make sure that the execution of the first query does not alter the performance of the second. In a Google Search, I could find these commands: DBCC FREESYSTEMCACHE DBCC FREESESSIONCACHE DBCC FREEPROCCACHE In fact, my queries are taking a more realistic time to complete after several executions than before. However, I'm not sure this is the recommended technique. What's the best practice?
Asked by andrerpena (981 rep)
Nov 28, 2011, 12:32 PM
Last activity: Apr 30, 2020, 02:57 PM