Click here to Skip to main content
16,018,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am SQL-SERVER Traniee

I got a doubt about deadlocks. at least 2-5 deadlocks are found daily in our system.
Is that too big number...?

Even if it is not, I came to know that having Proper Indexes on the tables can reduce the number of deadlock occurrences.But what does the word 'Proper Indexes' define.
almost all the tables got clustered indexes and some non clustered indexes.
Can any one clear my doubt 'Proper Indexes that can reduce the deadlock occurrences'

Is it possible to have a deadlock free system.
Posted
Comments
Sergey Alexandrovich Kryukov 22-Jan-15 11:42am    
Even one deadlock during single lifetime is impossibly too many. I am even starting to suspect that you mean not deadlock, but something else.
—SA

1 solution

First of all, very often a deadlock occurs because of application design. In a perfect world all the locking operations are executed in the same order for their corresponding resources so no deadlocks can occur. However, the world is not perfect :)

It's quite impossible to say if 2-5 deadlocks is too much but it sounds quite high to me.

Proper indexing may reduce deadlock occurences in such case when they speed up operations so that the probability of a deadlock is smaller.

However, keep in mind that this doesn't necessarily mean that you should add indexes. The situation may be vice versa. For example if you have a table where you just add new data, an index slows down the insert operation so the chance of a deadlock to occur rises. On the other hand speeding up deletions or updates can be achieved by adding indexes that support the where clauses of these operations.

So proper indexing actually means finding a good balance between all of the operations that are executed against the database.
 
Share this answer
 
Comments
K.Y.S.Phaneendra 22-Jan-15 8:57am    
Thank you
Wendelius 22-Jan-15 9:51am    
You're welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900