Forum Discussion
Deadlocks on High Frequency Updates
- Jan 23, 2025
Right off the bat: do you have a nonclustered index on the columns in the UPDATE statement's WHERE clause?
CREATE INDEX UsersAnswer_ncix ON UsersAnswer(For_Question,For_Quiz,FK_Answer);
If not, create it and monitor for changes in deadlock occurrence.
P.S. I'd recommend against turning the table into a heap by turning the PK into a NC index.
Rerun the transaction.
I don't understand what here the problem is? Deadlocks can occur in several different situation.
Application should be aware of and should do, what the error message already says: Rerun the transaction.
- sebdJan 24, 2025Copper Contributor
I was mainly worried that I misconfigured the database in terms of concurrency, or that the index was missing some parameter. This error slows down my platform, but I guess if the only solution is to rerun the transaction, than I need to upgrade the CPU of the server and maybe rerun the transactions with exponential backoff.