• FWIW, when I started my job a bit over a year ago, we were getting regular deadlocks. After some work to set up traces to trap all deadlocks, and to investigate the causes and do some re-coding / indexing, deadlocks on our systems are now a very rare event.

    my first big sql database was plagued with deadlocks during pre-production testing

    I managed to redesign the system and achieve zero deadlocks

    (it was a busy but simple / almost classic transaction processing application)

    I thought I could repeat that on any database ... but once the complexity increases

    the possible permutations of access becomes astronomical and what you have is a humungous race condition

    So now I design for zero deadlocks, fail then redesign for the high frequency deadlocks and let retry logic mop up the low frequency deadlocks