From: RG on
I am sure that at some point people in this forum had to compare response
times between variations of the same query. That is, considering there is a
lot going on the server, to be able to find 'even ground' and compare
apples to apples rather than apple to orages. Could someone tell me how to
me how would this need to be done and/or how to setup the envrionment.

Thanks in advance

From: Erland Sommarskog on
RG (nobody(a)nowhere.com) writes:
> I am sure that at some point people in this forum had to compare
> response times between variations of the same query. That is,
> considering there is a lot going on the server, to be able to find 'even
> ground' and compare apples to apples rather than apple to orages.
> Could someone tell me how to me how would this need to be done and/or
> how to setup the envrionment.

The best is of course to use an idle server, but this is not always
possible.

In such case, you can also look at CPU time and reads. You can also
run the queries a couple of times, in hope that the variations in load
evens out. The query plan can also give clues.

In many cases, the difference between two variations is either
insignificant, or so big that you don't need to worry about the
other load on the machine disturbing the benchmark. (But before
you jump to conclusion, check that you are not a victim to blocking.)


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx