有人可以帮我阅读/理解这个死锁图吗?
我不明白为什么进程 75 请求锁定他已经锁定的对象?
最佳答案
根据一篇博客文章,我发现“交换事件”的存在表明问题的根源可能是查询中的并行性。
Today's Annoyingly-Unwieldy Term: "Intra-Query Parallel Thread Deadlocks"
上面的文章更详细,但要点是:
Workaround #1: Add an index or improve the query to eliminate the need for parallelism. In most cases, the use of parallelism in a query indicates that you have a very large scan, sort, or join that isn't supported by proper indexes. If you tune the query, you will often find that you end up with a much quicker and more efficient plan that doesn't use parallelism, and therefore isn't subject to this type of problem. Of course, in some queries (DSS/OLAP-type queries, in particular) it may be difficult to eliminate all large scans.
Workaround #2: Force single-threaded execution with an "OPTION (MAXDOP 1)" query hint at the end of the query. If you can't modify the query, you can apply the hint to any query with a plan guide.
您可能想尝试一下,看看是否有任何改进。
关于sql - 读取SQL死锁图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7267942/