Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jpham
Starting Member
19 Posts |
Posted - 2006-11-06 : 19:50:12
|
Hi All,I have two SQL statement to run and wantto find which one is faster. I have ran the first oneand I want to clean up the cache so I can run thesecond one. Do you know what command to clean up the cache.Thanks,JP |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2006-11-06 : 20:15:01
|
DBCC FREEPROCCACHE and DBCC DROPCLEANBUFFERS |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-11-07 : 01:26:29
|
I do:-- SET SHOWPLAN_TEXT ONGOSET STATISTICS IO ON; SET STATISTICS TIME ONGOSELECT * FROM MyTableSET STATISTICS IO OFF; SET STATISTICS TIME OFFGOSET SET SHOWPLAN_TEXT OFFGO and then compare the two LOGICAL values (and ignore the PHYSICAL) to see the difference - smaller numbers are good!Physical numbers are a bit hit&miss - data might be in the caching controller of the disk, stuff may be fragmented, other tasks may be launched by the scheduler, windows update may install a newer, faster, version of SQL Server for free Kristen |
 |
|
|
|
|