SQL Server commands to clear caches before running a performance comparison
Personally, for a common query the 2nd and subsequent executions matter more.

Are you testing disk IO or query performance?

Assuming your query runs often and is critical, then you want to measure that under real life conditions. And you don't want to clear prod server caches each time...

If you want, you can:


DBCC DROPCLEANBUFFERS clears clean (unmodified) pages from the buffer pool
 Precede that with a CHECKPOINT to flush any dirty pages to disk first
DBCC FLUSHPROCINDB clears execution plans for that database


Also see (on DBA.SE)


Solving high page load time using SQL Profiler