New answers tagged

1 vote

How to determine if a query can potentially deadlock in Postgres?

I don't think that there is a principled formal approach to this. Besides, while it can happen, it is not a frequent occurrence that a single statement deadlocks with the same statement run in a ...
  • 40.5k
2 votes

Why my clustered index causing deadlock (Keylocks and Pagelocks)

most likely You have a read query deadlocking with a write query, which means one or both query plans have one or more key lookups in them. <owner-list> <owner id="...
  • 36.6k
1 vote

How to avoid deadlock inside transaction?

When a SELECT is "inside" a transaction (that is, between the BEGIN and COMMIT), Case 1: The Select has nothing to do with the subsequent updates/inserts/deleted (inside the transaction). ...
  • 73.7k
0 votes

Deadlock, update where id=pk_value with different pk_values, figure out reason and how to fix

You have 2 transactions, one moving 10 from one account to another, and another moving 0.22 between other accounts? We see 2 of the 4 ids, but we don't see the other two. I suspect that one of the ...
  • 73.7k
2 votes
Accepted

MySQL deadlock in simple table

As requested, my solution to an old question. The write intention lock docs say (emphasis mine, and yes, MySQL 5.7, because 8.0 didn't exist at the time): An insert intention lock is a type of gap ...
  • 181

Top 50 recent answers are included