Determining query speed

  • Hello everyone,

    I am wondering if there are tools available or logs that can be viewed to see what the actual time for executing a query was.

    I am still very new to all this and am playing around with creating various types of indexes and am curios if / how much gain I am getting based on the indexes I create.

    Any direction would be greatly appreciated.

  • If you are running your query through Query Analyzer, run SET STATISTICS TIME ON prior to running the query.  I would also recommend running DBCC FREEPROCCACHE, DBCC DROPCLEANBUFFERS, and SET STATISTICS IO ON.  If the query is comming from an application, use SQL Profiler to capture the SQL code.  You can configure that to report on Duration.  Keep in mind that there is more to making sure a query has been improved than the amount of time it takes to run.  You should concern youself with the # of logical reads that it takes to satisfy the query over time.  There are many posts here on SSC as well as SQLServerPerformance.com that deal with comparing query plans, reads, and duration. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • A lot of people use profiler for this. capture RPC completed for sprocs or t-sql statement completed for individual statements. This will give you an execution time. you can even export the results to a sql table for easier analysis

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply