SET STATISTICS TIME
SET STATISTICS PROFILE
SET STATISTICS IO
You can also choose in QA 'Query / Show Clients Statistics'.
Quote:> I'm trying to compare the execution times of two different queries on the
> same database. Is there something in Query Analyzer or Enterprise Manager
> that can do this?
I usually use SELECT getdate() in strategic places. Sometimes I might toQuote:> I'm trying to compare the execution times of two different queries on the
> same database. Is there something in Query Analyzer or Enterprise Manager
> that can do this?
EXEC test_stuff
Also, be sure to say DBCC DROPCLEANBUFFERS between the runs, else the
2nd versio can appear much faster, because the 1st version brought all
data pages into cache from disk.
--
Erland Sommarskog, SQL Server MVP
Books Online (updated!) for SQL 2000 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
BPM
> I usually use SELECT getdate() in strategic places. Sometimes I might to
> EXEC test_stuff
> Also, be sure to say DBCC DROPCLEANBUFFERS between the runs, else the
> 2nd versio can appear much faster, because the 1st version brought all
> data pages into cache from disk.
> --
> Erland Sommarskog, SQL Server MVP
> Books Online (updated!) for SQL 2000 at
> http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
We should also add the word of warning that these two are maybe not so
good to run in a production environment, as they flush the cache. A
system that relies heavily on its cache would see a temporary performance
degradation if you issue these commands, as a lot of pages would have
to read from disk all at a sudden.
--
Erland Sommarskog, SQL Server MVP
Books Online (updated!) for SQL 2000 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
1. Defer execution of Stored Procedure until some time in the future
See Management\SQL Server Agent\Jobs in Enterprise Manager
Mikhail Berlyant
Data Integrator, Data Systems
Launch Your Yahoo!Music Experience http://launch.yahoo.com
Brainbench MVP for Visual Basic www.brainbench.com
2. Tree View
3. Factors involved in the execution time of Stored Procedures
4. SELECT COUNT(*) or SELECT COUNT(id)
5. Execution time of stored procedure
6. RUNNING ACCESS QUERIES FROM VB6
7. Execution Time of Store Procedure
9. Timed Execution of Stored Procedures
10. Help with SQL execution time (stored procedure?)
11. Execution of Stored Procedure - Timed Out Error