Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Deadlock issue due to locking on resources


Deadlock issue due to locking on resources

Author
Message
Sudhakar Vallamsetty
Sudhakar Vallamsetty
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 77
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.

*******Cool
Sudhakar
Attachments
Graphs.zip (5 views, 2.00 KB)
k.thanigaivel
k.thanigaivel
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 852
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.
Sudhakar Vallamsetty
Sudhakar Vallamsetty
SSC Journeyman
SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)SSC Journeyman (91 reputation)

Group: General Forum Members
Points: 91 Visits: 77
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?

*******Cool
Sudhakar
k.thanigaivel
k.thanigaivel
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 852
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search