title: Query Execution time in Management Studio & profiler. What does it measure?
body: <p>I have my production SQL Server in a remote data center(and the web servers are located in the same data center). During development we observed that one particular view takes a long time to execute (about 60-80 secs) in our local development SQL Server, and we were OK with it.It was promoted to production and when I run the same query on Production DB (which is in the data center)from my local Management Studio I see that the query takes about 7 minutes,17 secs to run (available the bottom right corner of the management studio).When I ran a profiler I see that the time taken to execute that query is 437101 <del>microseconds</del> milliseconds, <del>though it shows up in management studio as 7:17. </del>, which actually is about 437101 milliseconds. My DBA says that in prod the view takes just about 60 to 80 seconds though I see different numbers from profiler and management studio.Can someone tell me what these durations mean in Profiler and management studio ?</p>
  
  <p>My guess: duration between sending the last request byte and receiving the last response byte from the server. The client statistics were as follows:
  Client Processing time: 90393
  Total Execution time:92221
  Wait time on server replies: 1828</p>
  
  <p>My best guess on what "duration" on the profiler means is "the time taken by SQL Server (optimization engine to parse the query,generate the query plan or use the existing query plan + fetch records from different pages) to generate the result set which excludes the time taken by data to travel over the wire to the client"</p>
  
  <p>Edit: I find that both these times are about the same (management studio vs profiler). How do they relate with the times I see in client statistics ?</p>
  
  <p>Can some one throw more light on these ?</p>