Deadlock issue due to locking on resources

  • In our production environment, we are seeing frequest deadlocks due to locks on the resources. I have attached DeadlockGraphs captured for the same. Need your help on finding the fix to solve the problem.

    Thanks in advance.

    *******:cool:
    Sudhakar

  • can you tell me size of tableA and execution time for the below query?

    SELECT * from FROM tableA

    UPDATE A SET A.IsError=1 FROM Table1 A LEFT JOIN Table2 B ON B.Id=A.Id LEFT JOIN Table3 C ON C.Id = A.Id WHERE (C.Id IS NOT NULL OR B.Id IS NOT NULL) UPDATE A SET A.IsError=1 FROM Table1 A LEFT JOIN Table2 B ON B.Id = A.Id LEFT JOIN Table3 C ON C.Id = A.Id WHERE (C.Id IS NOT NULL OR B.Id IS NOT NULL)

    Thanigaivel.

  • Below is the size of the tableA

    namerowsreserved data index_sizeunused

    TableA49132 19352 KB 8464 KB 10280 KB608 KB

    Select * from tableA - took 00:00:01

    Update query - took 00:00:01

    Adding additional indexes will fix the issue? or providing locking hint in the queries will be the best option to fix it?

    *******:cool:
    Sudhakar

  • Either we can use lock hint based on sensitive of data or Non Clustered Index which will create addition maintenance work. My choice is Non Clustered index.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply