Isolationlevel="Read committed"
Multiple UPDATE statements are made to a Table which has only 1 Unique Clustered Index.InterestList_ID is the column which has the index.The update statements are getting deadlocked.
The graph is mentioned below.Its clear that Row level locking is not happening here as the update statements are for different rows within the table.
Is the reason just because a clustered Index Scan is happening for the Update statements or there are anything else which needs to be isolated here.
What best course of action can be taken for situation like these where there will be lot of UPDATES going on for a table and reduce potential dead locks.
<deadlock-list>
<deadlock victim="process5f3f438">
<process-list>
<process id="process52e1828" taskpriority="0" logused="580" waitresource="KEY: 202:72057594178240512 (e50029fd93f1)" waittime="15109" ownerId="593539985" transactionname="user_transaction" lasttranstarted="2012-05-02T10:52:08.423" XDES="0x395bf6cb0"
lockMode="U" schedulerid="4" kpid="5544" status="suspended" spid="186" sbid="0" ecid="0" priority="0" transcount="2" lastbatchstarted="2012-05-02T10:52:19.680" lastbatchcompleted="2012-05-02T10:52:19.640" clientapp=".Net SqlClient Data Provider" hostname="WAFFFAPARAPP10"
hostpid="2328" loginname="PAN" isolationlevel="read committed (2)" xactid="593539985" currentdb="202" lockTimeout="4294967295" clientoption1="671088928" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="864" sqlhandle="0x02000000a9f8ba394e9a78b74f96de323de665be8b852ba0">
UPDATE [Customers_PHMD_Interests] set [Registered_Date] = @1,[Lead_Source] = @2,[Region] = @3,[MPC_Community] = @4,[Neighborhood] = @5,[Preferred_State] = @6,[Comments] = @7,[PhoneNumber] = @8,[AddressLine1] = @9,[City] = @10,[State] = @11,[ZipCode] = @12,[LicenceNo]
= @13,[Builder] = @14,[PlanName] = @15,[PriceRange] = @16,[PreferredMarket] = @17,[BestContact] = @18,[HowHeard] = @19,[TimeFrame] = @20,[PANCorporate] = @21,[Updt_User_ID] = @22,[Updt_DateTime] = getdate(),[Uptd_Prgm] = @23,[PreferredProperty] = @24
WHERE [InterestList_ID]=@25 </frame>
<frame procname="adhoc" line="1" sqlhandle="0x02000000a162ac072885f023e4c59de30982cc11d01151e4">
UPDATE Customers_PHMD_Interests SET Registered_Date = '9/2/2009 6:21:02 PM', Lead_Source = 'NewHomeSource', Region = '3', MPC_Community = '12', Neighborhood = '59',
Preferred_State = 'CA', Comments = 'Lead Type: Brochure', PhoneNumber = '', AddressLine1 = '746 N E St.', City = '', State = '', ZipCode
= '', LicenceNo = '', Builder = 'PAN', PlanName = '', PriceRange = '', PreferredMarket = 'Riverside-San Bernardino',BestContact = '',
HowHeard = 'NewHomeSource', TimeFrame = '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = ''
WHERE InterestList_ID = 'NHS_3290' </frame>
</executionStack>
<inputbuf>
UPDATE Customers_PHMD_Interests SET Registered_Date = '9/2/2009 6:21:02 PM', Lead_Source = 'NewHomeSource', Region = '3', MPC_Community = '12', Neighborhood = '59',
Preferred_State = 'CA', Comments = 'Lead Type: Brochure', PhoneNumber = '', AddressLine1 = '746 N E St.', City = '', State = '', ZipCode
= '', LicenceNo = '', Builder = 'PAN', PlanName = '', PriceRange = '', PreferredMarket = 'Riverside-San Bernardino',BestContact = '',
HowHeard = 'NewHomeSource', TimeFrame = '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = ''
WHERE InterestList_ID = 'NHS_3290' </inputbuf>
</process>
<process id="process5f23198" taskpriority="0" logused="0" waitresource="KEY: 202:72057594178240512 (e50029fd93f1)" waittime="25015" ownerId="593539009" transactionname="user_transaction" lasttranstarted="2012-05-02T10:52:04.433" XDES="0x95e63850"
lockMode="U" schedulerid="7" kpid="4516" status="suspended" spid="275" sbid="0" ecid="0" priority="0" transcount="2" lastbatchstarted="2012-05-02T10:52:09.793" lastbatchcompleted="2012-05-02T10:52:09.753" clientapp=".Net SqlClient Data Provider" hostname="WAFFFAPARAPP10"
hostpid="2328" loginname="PAN" isolationlevel="read committed (2)" xactid="593539009" currentdb="202" lockTimeout="4294967295" clientoption1="671088928" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="864" sqlhandle="0x02000000a9f8ba394e9a78b74f96de323de665be8b852ba0">
UPDATE [Customers_PHMD_Interests] set [Registered_Date] = @1,[Lead_Source] = @2,[Region] = @3,[MPC_Community] = @4,[Neighborhood] = @5,[Preferred_State] = @6,[Comments] = @7,[PhoneNumber] = @8,[AddressLine1] = @9,[City] = @10,[State] = @11,[ZipCode] = @12,[LicenceNo]
= @13,[Builder] = @14,[PlanName] = @15,[PriceRange] = @16,[PreferredMarket] = @17,[BestContact] = @18,[HowHeard] = @19,[TimeFrame] = @20,[PANCorporate] = @21,[Updt_User_ID] = @22,[Updt_DateTime] = getdate(),[Uptd_Prgm] = @23,[PreferredProperty] = @24
WHERE [InterestList_ID]=@25 </frame>
<frame procname="adhoc" line="1" sqlhandle="0x02000000b98a333343228e3ceb5c872637265e0c72213120">
UPDATE Customers_PHMD_Interests SET Registered_Date = '5/1/2012 1:55:42 PM', Lead_Source = 'Inquiry User Profile', Region = '', MPC_Community = '', Neighborhood = '',
Preferred_State = '', Comments = '', PhoneNumber = '', AddressLine1 = '', City = '', State = '', ZipCode = '', LicenceNo
= '', Builder = 'PAN', PlanName = '', PriceRange = '', PreferredMarket = '',BestContact = '', HowHeard = '', TimeFrame
= '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = '' WHERE InterestList_ID = '_8814' </frame>
</executionStack>
<inputbuf>
UPDATE Customers_PHMD_Interests SET Registered_Date = '5/1/2012 1:55:42 PM', Lead_Source = 'Inquiry User Profile', Region = '', MPC_Community = '', Neighborhood = '',
Preferred_State = '', Comments = '', PhoneNumber = '', AddressLine1 = '', City = '', State = '', ZipCode = '', LicenceNo
= '', Builder = 'PAN', PlanName = '', PriceRange = '', PreferredMarket = '',BestContact = '', HowHeard = '', TimeFrame
= '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = '' WHERE InterestList_ID = '_8814' </inputbuf>
</process>
<process id="process5f3f438" taskpriority="0" logused="0" waitresource="KEY: 202:72057594178240512 (da00f8bc7ead)" waittime="13796" ownerId="593540033" transactionname="user_transaction" lasttranstarted="2012-05-02T10:52:08.423" XDES="0x80835760"
lockMode="U" schedulerid="9" kpid="2456" status="suspended" spid="204" sbid="0" ecid="0" priority="0" transcount="2" lastbatchstarted="2012-05-02T10:52:19.740" lastbatchcompleted="2012-05-02T10:52:19.700" clientapp=".Net SqlClient Data Provider" hostname="WAFFFAPARAPP10"
hostpid="2328" loginname="PAN" isolationlevel="read committed (2)" xactid="593540033" currentdb="202" lockTimeout="4294967295" clientoption1="671088928" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="864" sqlhandle="0x02000000a9f8ba394e9a78b74f96de323de665be8b852ba0">
UPDATE [Customers_PHMD_Interests] set [Registered_Date] = @1,[Lead_Source] = @2,[Region] = @3,[MPC_Community] = @4,[Neighborhood] = @5,[Preferred_State] = @6,[Comments] = @7,[PhoneNumber] = @8,[AddressLine1] = @9,[City] = @10,[State] = @11,[ZipCode] = @12,[LicenceNo]
= @13,[Builder] = @14,[PlanName] = @15,[PriceRange] = @16,[PreferredMarket] = @17,[BestContact] = @18,[HowHeard] = @19,[TimeFrame] = @20,[PANCorporate] = @21,[Updt_User_ID] = @22,[Updt_DateTime] = getdate(),[Uptd_Prgm] = @23,[PreferredProperty] = @24
WHERE [InterestList_ID]=@25 </frame>
<frame procname="adhoc" line="1" sqlhandle="0x020000009afcb025a39b753277d383c3ac8e9d9e7f164d7b">
UPDATE Customers_PHMD_Interests SET Registered_Date = '9/3/2009 1:06:05 AM', Lead_Source = 'NewHomeSource', Region = '10', MPC_Community = '3', Neighborhood = '6',
Preferred_State = 'CA', Comments = 'Lead Type: Events and Promotions', PhoneNumber = '', AddressLine1 = '91320', City = '', State = '',
ZipCode = '', LicenceNo = '', Builder = 'PAN', PlanName = '3A 3A', PriceRange = '818000.00', PreferredMarket = 'San Diego',BestContact = '',
HowHeard = 'NewHomeSource', TimeFrame = '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = '0021
5893 GABLEWOOD WAY' WHERE InterestList_ID = 'NHS_3293' </frame>
</executionStack>
<inputbuf>
UPDATE Customers_PHMD_Interests SET Registered_Date = '9/3/2009 1:06:05 AM', Lead_Source = 'NewHomeSource', Region = '10', MPC_Community = '3', Neighborhood = '6',
Preferred_State = 'CA', Comments = 'Lead Type: Events and Promotions', PhoneNumber = '', AddressLine1 = '91320', City = '', State = '',
ZipCode = '', LicenceNo = '', Builder = 'PAN', PlanName = '3A 3A', PriceRange = '818000.00', PreferredMarket = 'San Diego',BestContact = '',
HowHeard = 'NewHomeSource', TimeFrame = '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = '0021
5893 GABLEWOOD WAY' WHERE InterestList_ID = 'NHS_3293' </inputbuf>
</process>
<process id="process6b652e8" taskpriority="0" logused="492" waitresource="KEY: 202:72057594178240512 (da00f8bc7ead)" waittime="7718" ownerId="593536835" transactionname="user_transaction" lasttranstarted="2012-05-02T10:52:00.933" XDES="0x2732a89a0"
lockMode="U" schedulerid="10" kpid="1320" status="suspended" spid="257" sbid="0" ecid="0" priority="0" transcount="2" lastbatchstarted="2012-05-02T10:52:24.810" lastbatchcompleted="2012-05-02T10:52:24.763" clientapp=".Net SqlClient Data Provider" hostname="WAFFFAPARAPP10"
hostpid="2328" loginname="PAN" isolationlevel="read committed (2)" xactid="593536835" currentdb="202" lockTimeout="4294967295" clientoption1="671088928" clientoption2="128056">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="864" sqlhandle="0x02000000a9f8ba394e9a78b74f96de323de665be8b852ba0">
UPDATE [Customers_PHMD_Interests] set [Registered_Date] = @1,[Lead_Source] = @2,[Region] = @3,[MPC_Community] = @4,[Neighborhood] = @5,[Preferred_State] = @6,[Comments] = @7,[PhoneNumber] = @8,[AddressLine1] = @9,[City] = @10,[State] = @11,[ZipCode] = @12,[LicenceNo]
= @13,[Builder] = @14,[PlanName] = @15,[PriceRange] = @16,[PreferredMarket] = @17,[BestContact] = @18,[HowHeard] = @19,[TimeFrame] = @20,[PANCorporate] = @21,[Updt_User_ID] = @22,[Updt_DateTime] = getdate(),[Uptd_Prgm] = @23,[PreferredProperty] = @24
WHERE [InterestList_ID]=@25 </frame>
<frame procname="adhoc" line="1" sqlhandle="0x02000000b473341f9dc1daf9ca9f9ec70cf55b8ffe91d529">
UPDATE Customers_PHMD_Interests SET Registered_Date = '5/1/2012 10:36:05 AM', Lead_Source = 'PANHomesQuickReg', Region = '10', MPC_Community = '30', Neighborhood = '93',
Preferred_State = '', Comments = '', PhoneNumber = '', AddressLine1 = '92130', City = '', State = '', ZipCode = '', LicenceNo
= '', Builder = 'PAN', PlanName = '', PriceRange = '', PreferredMarket = '',BestContact = '', HowHeard = '', TimeFrame
= '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = '' WHERE InterestList_ID = 'PHQR_2253' </frame>
</executionStack>
<inputbuf>
UPDATE Customers_PHMD_Interests SET Registered_Date = '5/1/2012 10:36:05 AM', Lead_Source = 'PANHomesQuickReg', Region = '10', MPC_Community = '30', Neighborhood = '93',
Preferred_State = '', Comments = '', PhoneNumber = '', AddressLine1 = '92130', City = '', State = '', ZipCode = '', LicenceNo
= '', Builder = 'PAN', PlanName = '', PriceRange = '', PreferredMarket = '',BestContact = '', HowHeard = '', TimeFrame
= '', PANCorporate = '', Updt_User_ID = 1, Updt_DateTime = getdate(), Uptd_Prgm = 'PHMDIntegration', PreferredProperty = '' WHERE InterestList_ID = 'PHQR_2253' </inputbuf>
</process>
</process-list>
<resource-list>
<keylock hobtid="72057594178240512" dbid="202" objectname="AST_CRM_DEV.dbo.Customers_PHMD_Interests" indexname="PK_Customers_Interests" id="lock802a7300" mode="X" associatedObjectId="72057594178240512">
<owner-list>
<owner id="process6b652e8" mode="X"/>
</owner-list>
<waiter-list>
<waiter id="process5f23198" mode="U" requestType="wait"/>
<waiter id="process52e1828" mode="U" requestType="wait"/>
</waiter-list>
</keylock>
<keylock hobtid="72057594178240512" dbid="202" objectname="AST_CRM_DEV.dbo.Customers_PHMD_Interests" indexname="PK_Customers_Interests" id="lock90291680" mode="X" associatedObjectId="72057594178240512">
<owner-list>
<owner id="process52e1828" mode="X"/>
</owner-list>
<waiter-list>
<waiter id="process5f3f438" mode="U" requestType="wait"/>
<waiter id="process6b652e8" mode="U" requestType="wait"/>
</waiter-list>
</keylock>
</resource-list>
</deadlock>
</deadlock-list>
Thanks in advance,
Anup
Anup | Database Consultant
Blog: www.sqlsailor.com Twitter: Follow me !
Please use Mark as Answer if my post solved your problem and useVote As Helpful if a post was useful.