120-500毫秒之间SNIReadSync执行一个简单的查询。我看不为? [英] SNIReadSync executing between 120-500 ms for a simple query. What do I look for?
问题描述
我对执行一个简单的查询的SQL Server 2005:
I am executing a simple query against SQL Server 2005:
protected static void InitConnection(IDbCommand cmd) {
cmd.CommandText = "set transaction isolation level read uncommitted ";
cmd.ExecuteNonQuery();
}
每当我配置文件与dotTrace 3.1,它声称SNIReadSync方法以在100 - 500毫秒
Whenever I profile with dotTrace 3.1, it claims that SNIReadSync method is taking between 100 - 500 ms.
什么样的事情,我需要寻找为了得到这时候下来?
What sort of things do I need to be looking for in order to get this time down?
谢谢!
推荐答案
我没有测试过,但会想知道你是否有同样的问题,如果你使用一个TransactionScope与IsolationLevel.ReadUncommitted的选项。你将不得不封装的完整的呼叫,并应否定需要这种说法。我知道这说法是不是你的基本关注,但在一般。
I have not tested, but would wonder if you have the same issue if you used a TransactionScope with the options of IsolationLevel.ReadUncommitted. You would have to encapsulate your complete set of calls and that should negate the need for this statement. I realize that this statement is not your basic concern, but in general.
这是你可以做的另一件事是创建一个DBConnectionScope类(或者利用一个值得信赖的供应商的类),并减少所打开的连接总数。
Another thing that you can do is to create a DBConnectionScope class (or leverage a trusted vendor's class) and cut down on the total number of connections that are opened.
这篇关于120-500毫秒之间SNIReadSync执行一个简单的查询。我看不为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!