If you for example need to test a query against two SQL servers hardware, its a good idea to clear the cache first.
This query can do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
DBCC DROPCLEANBUFFERS; -- Removes all elements from the plan cache. DBCC FREEPROCCACHE; -- Displays the number of milliseconds required to parse, compile, and execute each statement. SET STATISTICS TIME ON; -- Display information regarding the amount of disk activity generated by Transact-SQL statements. SET STATISTICS IO ON; |