[英]Insert/Update Table Locks on SQL Server
I have a big table with around 70 columns in SQL Server 2008. A multithreaded .NET application is calling a stored proc on database to insert into / update the table. 我在SQL Server 2008中有一个约有70列的大表。一个多线程.NET应用程序正在数据库上调用存储的proc,以插入/更新表。 Frequency is around 3 times a second. 频率大约是每秒3次。
I have made weekly partitions on table since almost every query has a datetime
constraint on the table. 因为几乎每个查询在表上都有datetime
约束,所以我对表进行了每周分区。
Sometimes it takes a long time to insert/update the table. 有时需要很长时间才能插入/更新表。 I am suspicious that sometimes INSERTION makes UPDATE wait; 我怀疑有时INSERTION使UPDATE等待。 sometimes UPDATE makes INSERTION wait. 有时UPDATE使INSERTION等待。 Is it possible? 可能吗?
How can I design the table to avoid such locks? 如何设计表以避免此类锁定? Performance is the main issue here. 性能是这里的主要问题。
You're right that you're probably hitting deadlocks causing things to wait. 没错,您可能正在陷入僵局,导致事情等待。 A couple things to check first; 首先要检查几件事;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.