|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Sunday, May 12, 2013 4:26 PM
Points: 1,696,
Visits: 1,742
|
|
doobya (2/3/2009) SQL 2005 has xml deadlock report in profilerwhich will track deadlock down to tables and stored procedure statementsI think your solution does not solve the deadlock - just makes it less likelyIf the db+app had been designed correctly the omission of the index would have reduced performance but not created deadlocks
Take a look at the article from yesterdy. A missing/incorrect index can most definitely be the cause of a deadlock. In fact most deadlocks are simple index issues. Very rarely do I see a deadlock that doesn't involve cross locking indexes on a single table, though it does happen at times.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008 My Blog | Twitter | MVP Profile Training | Consulting | Become a SQLskills Insider Troubleshooting SQL Server: A Guide for Accidental DBAs
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, January 24, 2013 1:58 PM
Points: 6,
Visits: 21
|
|
:) Very interesting and with many information I didn't know. One more, does the ALLOW_PAGE_LOCKS option on indexes in the tables involved matters for deadlocks? thanks Albert
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 10:50 AM
Points: 23,
Visits: 32
|
|
totally agree: how hard would an interface using the simple steps outlined in the article be to generate a quick pull of that page.
Would help in profiling and devo evoluton too.
sigh.....
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 10:50 AM
Points: 23,
Visits: 32
|
|
great response, except, what if the indexes exist? The article is valid as you say, for finding deadlocks in general and therefore has worth.
r
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 7:07 AM
Points: 146,
Visits: 421
|
|
Jonathan Kehayias (2/3/2009) Take a look at the article from yesterdy. A missing/incorrect index can most definitely be the cause of a deadlock. In fact most deadlocks are simple index issues. Very rarely do I see a deadlock that doesn't involve cross locking indexes on a single table, though it does happen at times.
That is an interesting article. I am surprised that the lock acquisition against a single table for a single statement isn't batched and serialized!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Sunday, May 12, 2013 4:26 PM
Points: 1,696,
Visits: 1,742
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Sunday, May 12, 2013 4:26 PM
Points: 1,696,
Visits: 1,742
|
|
doobya (2/3/2009)
Jonathan Kehayias (2/3/2009) Take a look at the article from yesterdy. A missing/incorrect index can most definitely be the cause of a deadlock. In fact most deadlocks are simple index issues. Very rarely do I see a deadlock that doesn't involve cross locking indexes on a single table, though it does happen at times. That is an interesting article. I am surprised that the lock acquisition against a single table for a single statement isn't batched and serialized!
I am not sure what you mean in this statement? The SH locks are required to ensure consistency during the lookup process across resources. You can certainly change issolation levels and affect they types of locks taken by the SELECT, but that isn't necessarily a solution to the problem depending on the issolation level that you decide to use.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008 My Blog | Twitter | MVP Profile Training | Consulting | Become a SQLskills Insider Troubleshooting SQL Server: A Guide for Accidental DBAs
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, July 18, 2009 8:39 PM
Points: 4,
Visits: 6
|
|
| :D thanks for taking the time to put this together...very useful
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, August 11, 2010 2:04 AM
Points: 1,
Visits: 16
|
|
"As there was only one non-clustered index existing on that table, I created a clustered index on the table on the ID column with this command"
I understand not having an index on the ID column. Would creating a non-clustered index on this column haved solved the problem as well, or did you have a specific reason to chose for the clusterred one.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, October 04, 2010 6:59 AM
Points: 113,
Visits: 119
|
|
Useful intro on identifying deadlocks.
The part that concerned me more was: "As part of the upgrade, the application team performed modifications to the stored procedure code such that every insertion may cause up to 10 updates in the table."
Why would so many updates need to happen on the same table from a single insert? The sprocs/functions used in between must be low level and small to have caused so many updates?
If it's status updates, that's ALOT of status updates.
I guess as long as the code works now and it's no deadlocking it's ok?
|
|
|
|