Note that there are some explanatory texts on larger screens.

plurals
  1. POdeadlock between two select statements
    primarykey
    data
    text
    <p>I have two SQL select statements that are deadlocking.. I was under the impression that selects could not deadlock with each other?</p> <p>It is also puzzling that the query takes page locks on a select statement, could the indexes be causing this?</p> <p><img src="https://i.stack.imgur.com/0IYTo.png" alt="table Description"></p> <pre><code>&lt;deadlock-list&gt; &lt;deadlock victim="process1cf0ce928"&gt; &lt;process-list&gt; &lt;process id="process1cf0ce928" taskpriority="0" logused="8580" waitresource="PAGE: 11:1:168082 " waittime="4116" ownerId="24335138" transactionname="user_transaction" lasttranstarted="2013-10-01T23:04:04.353" XDES="0x2aa2f8d28" lockMode="S" schedulerid="2" kpid="6356" status="suspended" spid="62" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2013-10-01T23:04:06.907" lastbatchcompleted="2013-10-01T23:04:06.903" lastattention="1900-01-01T00:00:00.903" clientapp=".Net SqlClient Data Provider" hostname="******" hostpid="5892" loginname="*****" isolationlevel="read committed (2)" xactid="24335138" currentdb="11" lockTimeout="4294967295" clientoption1="673185824" clientoption2="128056"&gt; &lt;executionStack&gt; &lt;frame procname="DB.dbo.GetCommandById" line="22" stmtstart="1586" stmtend="1726" sqlhandle="0x03000b00edb44b1eebd677013da2000001000000000000000000000000000000000000000000000000000000"&gt; SELECT Top 1 * FROM [Commands] WHERE [Command_ID] = @CmdId; &lt;/frame&gt; &lt;/executionStack&gt; &lt;inputbuf&gt; Proc [Database Id = 11 Object Id = 508277997] &lt;/inputbuf&gt; &lt;/process&gt; &lt;process id="process1caa24cf8" taskpriority="0" logused="9876" waitresource="PAGE: 11:1:168082 " waittime="4104" ownerId="24335088" transactionname="user_transaction" lasttranstarted="2013-10-01T23:04:04.180" XDES="0x24f9956a8" lockMode="S" schedulerid="2" kpid="3872" status="suspended" spid="52" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2013-10-01T23:04:06.917" lastbatchcompleted="2013-10-01T23:04:06.903" lastattention="1900-01-01T00:00:00.903" clientapp=".Net SqlClient Data Provider" hostname="*****" hostpid="5892" loginname="*****" isolationlevel="read committed (2)" xactid="24335088" currentdb="11" lockTimeout="4294967295" clientoption1="673185824" clientoption2="128056"&gt; &lt;executionStack&gt; &lt;frame procname="DB.dbo.GetCommandById" line="22" stmtstart="1586" stmtend="1726" sqlhandle="0x03000b00edb44b1eebd677013da2000001000000000000000000000000000000000000000000000000000000"&gt; SELECT Top 1 * FROM [Commands] WHERE [Command_ID] = @CmdId; &lt;/frame&gt; &lt;/executionStack&gt; &lt;inputbuf&gt; Proc [Database Id = 11 Object Id = 508277997] &lt;/inputbuf&gt; &lt;/process&gt; &lt;/process-list&gt; &lt;resource-list&gt; &lt;pagelock fileid="1" pageid="168082" dbid="11" subresource="FULL" objectname="DB.dbo.Commands" id="lock22626c880" mode="IX" associatedObjectId="72057795337322496"&gt; &lt;owner-list&gt; &lt;owner id="process1caa24cf8" mode="IX"/&gt; &lt;owner id="process1caa24cf8" mode="S" requestType="convert"/&gt; &lt;/owner-list&gt; &lt;waiter-list&gt; &lt;waiter id="process1cf0ce928" mode="S" requestType="convert"/&gt; &lt;/waiter-list&gt; &lt;/pagelock&gt; &lt;pagelock fileid="1" pageid="168082" dbid="11" subresource="FULL" objectname="DB.dbo.Commands" id="lock22626c880" mode="IX" associatedObjectId="72057795337322496"&gt; &lt;owner-list&gt; &lt;owner id="process1cf0ce928" mode="IX"/&gt; &lt;owner id="process1cf0ce928" mode="S" requestType="convert"/&gt; &lt;/owner-list&gt; &lt;waiter-list&gt; &lt;waiter id="process1caa24cf8" mode="S" requestType="convert"/&gt; &lt;/waiter-list&gt; &lt;/pagelock&gt; &lt;/resource-list&gt; &lt;/deadlock&gt; &lt;/deadlock-list&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload