Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Question about proper index on table to minimize deadlocking

$
0
0

We have a deadlocking issue when two queries try to access the same table. (Sql 2005 Profiler shows us the deadlock. The INSERT statement is the "winner" and the SELECT against the same table the "victim"). The table involved has no indexes at all except for a primary key index. The INSERT use 5 table fields in its "WHERE\AND" clause. The SELECT statement uses the same 5 fields plus an additional 3 fields. If I want to create an index on that table to address this deadlocking would it include all 8 fields used by the SELECT statement or only the 5 used by the INSERT?

TIA,

edm2


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>