Which effects have UPDATEs on REFERENCEd TABLEs when only columns in the
referenced table are updated which are not part of the FOREIGN KEY
I have one "master"-table like
create table t_master (
m_id serial primary key,
The table above is referenced from several (~30) other tables, i.e. like
create table t_detail (
d_ebid int REFERENCES t_master (m_id) ON UPDATE CASCADE ON DELETE CASCADE,
All tables which reference t_master have appropriate indexes on the
referencing columns, vacuum/analyze is done regularly (daily).
Does an UPDATE of e.g. m_fld1 in t_master cause a 'lookup' in all tables
which have a cascading update-rule or is this 'lookup' only triggered if
the referenced column in t_master is explicitly updated? After removing
some detail tables which are not longer needed we see an improvemed
performance so at the moment it _looks_ like each update in t_master
triggers a 'lookup' in each referencing table also if the referenced
column (m_id) is not changed.
I've read "If the row is updated, but the referenced column is not
actually changed, no action is done." in the docs but it is not clear
for me whether this "no action" really means "null action" and so the
improved performance has other reasons.
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?