Re:A terrible schema from a clueless programmer
by zeroimpl on Sunday November 07, 2021 @03:45PM
(#29143357)
Yeah I’ve run into this a few times. In Postgres, you can’t add a foreign key referencing columns that aren’t indexed. I assume this is for performance reasons so inserts/updates are efficient, but there is no such check that the source columns are also indexed, so updates/deletes on the referenced table can be terribly slow.
[ Parent
| on HN ]
Re:A terrible schema from a clueless programmer
by ComputerGuru on Monday November 08, 2021 @12:29AM
(#29146337)
Isn’t the source almost always an indexed primary key?