Ado.net Performance: What does SNIReadSync do?

We have a query that takes 2 seconds to run in Sql Server Management Studio, but it takes 13 seconds on the client screen. I used dotTrace to profile the source code and noticed that this SNIReadSync method (part of the ADO.net collections) takes a long time to complete its task (9 seconds). I ran my source on the server so that I could omit the network effects and the result was the same.

It doesn't matter if I use OleDBConnection or SqlConnection.

It doesn't matter if I'm using a DataReader or a DataSet.

The connection pool does not solve this problem (as my result shows).

I was looking for this problem, and I could not find the answer to the question of what this method really does and how we can improve it.

here is what i found on StakOverFlow, which is also not useful: https://stackoverflow.com/a/316835/ ...

+3
source share
1 answer

Ignoring SNIReadSyncfor a moment (I think it could be a red herring).

The symptoms you describe sound like an incorrectly cached query plan.

Update your statistics (or rebuild indexes) and see if this is all happening.

+2
source

Source: https://habr.com/ru/post/1734833/


All Articles