Yes, foreign keys are implemented using triggers. Here is a blog post
explaining a little more:
http://bonesmoses.org/2014/05/14/foreign-keys-are-not-free/
I would assume it's still got to do a seq scan even on every referencing
table even if it's empty for every record since there are no indexes.
Hi,
I was trying to clean a database by deleting records of some of its tables.
But in our model we have a table that is heavily referenced, that is, many
tables reference this particular table by foreign key constraints. We don't
have foreign key indexes, so executing a delete from mytable takes