tsql - What All Should I do If I find a deadlock occurring in SQL server 2012? Are there a set of rules/steps I can follow to come out of it -


i identified couple of update statements on large partitioned table deadlock victims extended events. how should proceed fixing this?

this table doesn't have index. using uniqueidentifier (refguid) in clause of both these update statements. sql server execution plan suggesting create non clustered index on column. prevent/alleviate deadlocks?

thanks in advance.

solution alleviated deadlocks in case. created non clustered index on column being checked in clause. column being used in partition function not used in clause , hence not useful.

if deadlocks because there update , select statements same table @ same time, should first focus on getting both update , select statements touch small amount of pages possible. easy way started run statements using "set statistics io on" , see number of logical reads (or writes, lot smaller). lower i/o, less deadlock happen.

if there's several different columns in clause, should try focus on column(s) have highest selectivity, meaning ones there's least amount of rows per value. might useful have more 1 field in index, of course depends on data , sql statements. looking @ actual execution plan idea, remember percentages there estimates.

since table partitioned, make sure when possible, have included key used partitioning in clause. always, essential data types match (column vs search criteria). can see number of partitions accessed in actual plan (properties of object).

if process more complex , there's lot of updates different tables inside transactions, if possible, try make updates tables in same order.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -