I have followed this tutorial to get the wait stats of a particular query while it is 'in flight' using extended events. Whilst the tutorial refers to an index rebuild, I just did a select statement from a single table

The waits (using the query in the tutorial) were

Wait Type            Wait Count  Wait Time  Resource Wait Time  Signal Wait Time
-------------------  ----------  ---------  ------------------  ----------------
NETWORK_IO                  693        778                 776                 2
SOS_SCHEDULER_YIELD           6          0                   0                 0

I ran the query in SSMS on the same box the instance is installed on (used . as my server name when connecting) the data files for the database are on the C:/ drive of the box so I am confused as to why NETWORK_IO is showing?

As a further test, I disabled the network adapter on the box and found the same result (obviously with slightly different numbers)

Would I be right in thinking that NETWORK_IO relates to SQL server returning the result to SSMS?

  • Connecting to "." means you force the Named Pipes netlib, methinks. Which in turns means you go through the network layers in the OS. What is you connect using shared memory (either use the machine name, or preferrably specifying this netlib in the connection dialog)? – Tibor Karaszi Nov 20 '18 at 7:56

Usually this surfaces as ASYNC_NETWORK_IO outside of Extended Events, but yes, it is the time SQL Server spent waiting for the caller (in this case SSMS) to consume the results. If the caller is slow (like SSMS) then SQL Server has to sit there and wait before feeding more rows. If you have a wide result set or large values, you should compare results to grid and results to text. But really, you shouldn't be timing anything based on response times in SSMS, since it does unrealistic things with the data and how it renders that your application won't be doing (hopefully).

I wrote about this wait type (and 9 other common ones) here:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.