ADO.NET连接池和放大器; SQLServer的 [英] ADO.NET Connection Pooling & SQLServer
问题描述
- 这是什么?
- 如何实现与MS SQL连接池?
- 有哪些表现后果时
- 执行多个查询单后的(使用带有30K +反复调用存储过程的循环,即)其他?
- 执行几个查询需要较长的时间(10+分)?
- What is it?
- How do I implement connection pooling with MS SQL?
- What are the performance ramifications when
- Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)?
- Executing a few queries that take a long time (10+ min)?
推荐答案
连接池是一个机制,以重新使用连接,建立一个新的连接很慢。
Connection pooling is a mechanism to re-use connections, as establishing a new connection is slow.
如果您使用的是MSSQL的连接字符串和System.Data.SqlClient那么你已经在使用它 - 在.net这东西是引擎盖下的大部分时间
If you use an MSSQL connection string and System.Data.SqlClient then you're already using it - in .Net this stuff is under the hood most of the time.
30k的迭代环路可能会更好,因为服务器端游标(查找T-SQL游标语句),这取决于你在做什么与存储过程之外的每一个步骤。
A loop of 30k iterations might be better as a server side cursor (look up T-SQL cursor statements), depending on what you're doing with each step outside of the sproc.
长的查询都很好 - 但要小心,从网页调用它们作为Asp.Net是不是真的长时间等待优化,一些连接会切断。
Long queries are fine - but be careful calling them from web pages as Asp.Net isn't really optimised for long waits and some connections will cut out.
这篇关于ADO.NET连接池和放大器; SQLServer的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!