Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I am fairly convinced that most modern DBs have almost zero impact from relationship constraints

It cannot fundamentally be zero impact, the database needs to guarantee that the referred record actually exists at the time the transaction commits. Postgres takes a lock on all referenced foreign keys when inserting/updating rows, this is definitely not completely free.

Found this out when a plain insert statement caused a transaction deadlock under production load, fun times.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: