Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Are multi-field indexes dangerous?

$
0
0

Regarding the issue of deadlocks I've been posting about for some weeks, and just why I seem to be having more of them on these two projects than on any previous ones, we do have a large number of indexes on many tables, I've mentioned that, and FKs to use them, but what perhaps I haven't focused on before is that many of these indexes have multiple fields.  Just now we had a little deadlock on one secondary index with five fields, and another four included.

Both a mildly complex entity framework select and a fairly simple update statement in a stored procedure, were both using keylocks on this index.  The problem was probably more that the entity framework connection was (accidentally) running serialized.

But just looking at the situation, is it fair to worry at least a little bit, when you start proliferating multi-field indexes, that you may increase the odds of them being involved in a deadlock?   No doubt many of the indexes were put in as covering indexes on specific "important" transactions, mostly on the advice of the plan analyzer or tuning wizards.

Thanks,

Josh


Viewing all articles
Browse latest Browse all 12963

Trending Articles



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