title: How to understand the time spent in each step in execution plan?
body: <p>I am using <code>SQL Server</code> <code>Execution plan</code> to analysis my sql statement execution time. But I can't figure out the time spent on each step in the plan result. It looks like the result doesn't make sense to me.</p>
  
  <p>In my query, I have turned on below options:</p>
  
  <pre><code>SET STATISTICS TIME ON
  SET STATISTICS PROFILE ON
  </code></pre>
  
  <p>and I run the execution plan with <code>Actual Execution Plan</code> included. Below is the screenshot result:</p>
  
  <p><a href="https://i.stack.imgur.com/D1N3I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D1N3I.png" alt="enter image description here"></a></p>
  
  <p>There are some steps listed on the plan diagram and I can see each step execution time by clicking them and read the <code>Actual Time Statistics</code> on the right properties panel like below:</p>
  
  <p><a href="https://i.stack.imgur.com/BVgPU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BVgPU.png" alt="enter image description here"></a></p>
  
  <p>And in the message output I can see the total time for my query:</p>
  
  <pre><code>SQL Server Execution Times:
     CPU time = 47 ms,  elapsed time = 331 ms.
  SQL Server parse and compile time: 
     CPU time = 0 ms, elapsed time = 0 ms.
  
   SQL Server Execution Times:
     CPU time = 0 ms,  elapsed time = 0 ms.
  </code></pre>
  
  <p>You can see that it takes 331ms in total but the time spent on each step is very little which the most one is 14ms and most of others are 0. The total elapsed time from execution plan result is far less than the total 331ms. How can I understand the elapse time? Without that I can't figure out what the bottleneck in  my sql statement</p>