3 ms·
This one is my favorite: "Prevent non-key-field row updates from blocking foreign key checks (Álvaro Herrera, Noah Misch, Andres Freund, Alexander Shulgin, Mar
by JoelJacobson 13y ago
This one is my favorite:
"Prevent non-key-field row updates from blocking foreign key checks (Álvaro Herrera, Noah Misch, Andres Freund, Alexander Shulgin, Marti Raudsepp, Alexander Shulgin)
This change improves concurrency and reduces the probability of deadlocks when updating tables involved in a foreign-key constraint. UPDATEs that do not change any columns referenced in a foreign key now take the new NO KEY UPDATE lock mode on the row, while foreign key checks use the new KEY SHARE lock mode, which does not conflict with NO KEY UPDATE. So there is no blocking unless a foreign-key column is changed."
- jeltz 13y agoThanks Joel (I assume you are Joel at Trustly) for helping to get work started on fixing this source of deadlocks. I believe your company also helped fund some of the work on the fix. I have been bit by a race condition caused by this myself. EDIT: And even more thanks to Álvaro and the other developers working on it,
- minaguib 13y agoFor those unfamiliar with the issue, you can see it in action on my blog post written from the perspective of an app developer: http://mina.naguib.ca/blog/2010/11/22/postgresql-foreign-key-deadlocks.html http://mina.naguib.ca/blog/2010/11/22/postgresql-foreign-key...
- slurry 13y agoALEXANDER SHULGIN!!!!!????? http://en.m.wikipedia.org/wiki/Alexander_Shulgin http://en.m.wikipedia.org/wiki/Alexander_Shulgin
- amitlan 13y agoOr http://www.linkedin.com/pub/alexander-shulgin/3/a24/aa0 http://www.linkedin.com/pub/alexander-shulgin/3/a24/aa0
- scott_weber 13y ago(FirstName, LastName) is probably not a very good UNIQUE KEY.