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

Enable FKs for test and development, disable them in production, for tables that see billions of rows.

FKs have other downsides. They add locks on the referenced rows, to ensure they don't disappear before the transaction commits. If you start out with 32-bit primary keys, you have a major pain when you go over 2 billion records - incrementally upgrading all your FKs before your PK breaks your referential integrity, since FKs generally need to have the same type on each side.



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

Search: