How to find a query execution time in SQL 2000

  • Hi

    Given Constaints like table size, columns and indexes can we find out how long does a query takes to execute?

    Is it possible to find out wihtout actually executing the query?

     

  • You can select getdate() at the beginning and end of the query, but bear in mind this will only be accurate to 3ms.  You can also run Profiler and look at the Duration column for the particular event.  It's not possible to find out without executing the query since you don't know in advance what other factors will be in play at the time of execution.

    John

  • Hi John

     

    Thanks for the reply.Is there any way to get an estimation of the query execution time from the Query execution plan

    Thanks in advance

     

     

  • You can get an estimate of I/O and CPU cost, but in order to translate that into an execution time, the query optimiser would have to guess what hardware you have and how well it works, as well as what else will be happening on the server at the time the query is run.  So I'm afraid the answer to question is No.

    John

  • Is this related to notification services?  There is also "set statistics time on" and "set statistics io on" which can be handy. 

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • There are severals ways to find  execution time from the Query execution plan :

    http://www.sql-server-performance.com/query_execution_plan_analysis.asp

     

  • Mmmm.... I didn't find anything on that page about execution times.  But I like rstone's idea of SET STATISTICS TIME ON.

    John

Viewing 7 posts - 1 through 6 (of 6 total)

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