Wednesday, September 29, 2010

SQL query perfomance check method

you can check that how long each query takes to run... this should give you some idea which one performs better...

Code Snippet
DBCC DROPCLEANBUFFERS
SET STATISTICS IO ON
SET STATISTICS TIME ON
select top 10000 * from Table
SET STATISTICS TIME OFF
SET STATISTICS IO OFF

DBCC DROPCLEANBUFFERS
SET STATISTICS IO ON
SET STATISTICS TIME ON
Set rowcount 10000
Select * From Table
SET STATISTICS TIME OFF
SET STATISTICS IO OFF


No comments: