Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Administration
»
Posting Deadlock Data
Posting Deadlock Data
Rate Topic
Display Mode
Topic Options
Author
Message
David O
David O
Posted Wednesday, September 10, 2008 9:22 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 170,
Visits: 703
I have deadlock data (trace flag stuff) and corresponding trace data. What is the best way to include that data in a post?
David
Post #567028
GilaMonster
GilaMonster
Posted Wednesday, September 10, 2008 9:29 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 38,096,
Visits: 30,391
What format's the deadlock info? If it's the text deadlock graph from the error log, just put it into a post. Otherwise zip and attach and explain what's in the zip file.
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #567040
David O
David O
Posted Wednesday, September 10, 2008 9:54 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 170,
Visits: 703
Gail
So that is what the attachment button is for:D;)
Amazing what you learn when you scroll down.
Post #567068
David O
David O
Posted Wednesday, September 10, 2008 4:02 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 170,
Visits: 703
Ok, now that Gail has taught me how to post. :)
The attached file shows the statement level trace for the two deadlocking spids plus the deadlock collision from the errorlog. A deadlock should be a conflict over two resources between two processes. This data shows that deadlock happened over one resource (dbo.order_detail). I would have expected this to block and resolve not deadlock.
I'm getting multiple deadlocks a day on this procedure so it isn't a freak event.
Any thoughts or suggestions would be appreciated.
Post Attachments
PostDetails.txt
(
41 views,
7.37 KB
)
Post #567347
GilaMonster
GilaMonster
Posted Thursday, September 11, 2008 1:10 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 38,096,
Visits: 30,391
What it looks like is that both processes had a shared lock (probably from a foreign key check earlier on) and then both wanted an exclusive. Neither can get the exclusive until the other releases the share... deadlock.
Can you please post the procedure and indicate while is line 106, and also post the schema and indexes of the tables involved (at minimum the table that's actually been deleted on line 106)
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #567508
David O
David O
Posted Thursday, September 11, 2008 10:18 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 170,
Visits: 703
Gail
Thanks for the insight. I hadn't thought of that at all. I think I'm guilty of over-engineer my joins in an effort to address the previous deadlock issue. The Delphi code (yes, I work in a delphi shop please don't laugh to hard) had been deadlocking on it's use of sp_executesql.
Here is the code, any additional ideas would be appreciated.
Post Attachments
codeandschema.zip
(
19 views,
3.62 KB
)
Post #567910
David O
David O
Posted Friday, September 12, 2008 12:58 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 170,
Visits: 703
Found it!!!
Our freight calculation (delphi code) is doing a delete-insert every time freight is re-calculated. Freight has a item_number and we have three indexes that have the item number in the lead position. Every calculation is causing the indexes to be updated and affectively creating a hot spot where the deadlocks are happening.
We are going to change the calculation to use insert-update instead. Tracing for the locks:acquired in our development environment help me get the answer.
Gail, your point on the foriegn key got me going in a new direction and help find the contention point. Thanks for the assist.
David
Post #568871
GilaMonster
GilaMonster
Posted Saturday, September 13, 2008 3:10 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 38,096,
Visits: 30,391
Excellent. Glad you came right.
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #569021
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.