|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, September 21, 2012 2:54 AM
Points: 91,
Visits: 74
|
|
In our production environment, we are seeing frequest deadlocks due to locks on the resources. I have attached DeadlockGraphs captured for the same. Need your help on finding the fix to solve the problem.
Thanks in advance.
******* Sudhakar
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 12:01 AM
Points: 45,
Visits: 851
|
|
can you tell me size of tableA and execution time for the below query?
SELECT * from FROM tableA
UPDATE A SET A.IsError=1 FROM Table1 A LEFT JOIN Table2 B ON B.Id=A.Id LEFT JOIN Table3 C ON C.Id = A.Id WHERE (C.Id IS NOT NULL OR B.Id IS NOT NULL) UPDATE A SET A.IsError=1 FROM Table1 A LEFT JOIN Table2 B ON B.Id = A.Id LEFT JOIN Table3 C ON C.Id = A.Id WHERE (C.Id IS NOT NULL OR B.Id IS NOT NULL)
Thanigaivel.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, September 21, 2012 2:54 AM
Points: 91,
Visits: 74
|
|
Below is the size of the tableA
name rows reserved data index_size unused TableA 49132 19352 KB 8464 KB 10280 KB 608 KB
Select * from tableA - took 00:00:01 Update query - took 00:00:01
Adding additional indexes will fix the issue? or providing locking hint in the queries will be the best option to fix it?
******* Sudhakar
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 12:01 AM
Points: 45,
Visits: 851
|
|
Either we can use lock hint based on sensitive of data or Non Clustered Index which will create addition maintenance work. My choice is Non Clustered index.
|
|
|
|