• ft55 (4/29/2013)


    Recently we have started seeing some deadlocks reported on a database instance. I have enabled the trace -T1222 and am trying to interpret what has been returned in the logs : (the actual queries are quite lengthy)

    Spid 161 is running this query (line 14 of proc [1]):

    SELECT ...... from table1 .....

    Spid 98 is running this query (adhoc line 1 of proc [p2]):

    UPDATE .....from table1

    Spid 161 is waiting for a Shared page lock on index table1.idx1.

    (Spid 98 holds a conflicting IX lock.)

    Spid 98 is waiting for an (IX page lock on index table1.idx2.

    (Spid 161 holds a conflicting Shared lock.)

    Just after some advice on what I can look at to resolve the deadlock. My hands are a bit tied as the update command is being called by a suppliers application and this and the underlying tables cant be altered.

    The Select command is an in house process that we can look at changing but I'm not sure what can be done to the select statement to stop the lock. I have seen the NOLOCK table hint but I'm a little reluctant to suggest this as a solution.

    Thanks for any help

    Frant101

    You may want to examine the indexing of your table1. The UPDATE to table1 requires corresponding updates to every affected index, and your blocking seems to be occurring when the UPDATE is attempting to update the indexes. If you have redundant or unused indexes on table1, removing them may allow the UPDATE to complete efficiently enough to avoid the blocking.

    Jason Wolfkill