|
|
|
|
|
by JoelJacobson
1632 days ago
|
|
> I don't see a lot of harm from adding this syntax however as people are free to not use it and it relies on an existing strict convention. This is a good argument I will add to the list. Also interesting to read about un-enforced foreign keys. I haven't used MSSQL myself, the DB in which I heard it's possible, I've only been using PostgreSQL for the last 20 years, and before that MySQL. I think the problems you describe is an argument against a WITH NOCHECK feature, since it could be misused. Maybe it's necessary in some databases still, but at least in PostgreSQL, the FOR KEY SHARE lock solved all the issues with concurrent updates we had at Trustly. The FOR KEY SHARE was a huge patch [1] written mainly by Alvaro Herrera. Thanks to it, Trustly has never since had any performance problems with foreign keys, and they have AFAIK not needed to drop any foreign keys up until today due to locking/performance problems. [1] https://www.commandprompt.com/blog/fixing_foreign_key_deadlo... |
|