Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to benchmark a SQL Server Query?

I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.

like image 418
Corin Blaikie Avatar asked Aug 29 '08 17:08

Corin Blaikie


People also ask

What is SQL benchmarking?

In the database industry, a benchmark is a test in which you collect the performance metrics of a system under a specific, predefined workload.


2 Answers

set showplan_text on will show you the execution plan (to see it graphically use CTRL + K (sql 2000) or CTRL + M (sql 2005 +)

set statistics IO on will show you the reads

set statistics time on will show you the elapsed time

like image 101
SQLMenace Avatar answered Oct 04 '22 23:10

SQLMenace


Use SQL Profiler.

For .NET applications, filter that Application name by '.NET%' and you'll omit other extraneous queries.

like image 30
Ben Scheirman Avatar answered Oct 04 '22 23:10

Ben Scheirman