Re: Effects of cascading references in foreign keys - Mailing list pgsql-performance

From Tom Lane
Subject Re: Effects of cascading references in foreign keys
Date
Msg-id 12097.1130610925@sss.pgh.pa.us
Whole thread Raw
In response to Re: Effects of cascading references in foreign keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Effects of cascading references in foreign keys  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Effects of cascading references in foreign keys  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Effects of cascading references in foreign keys  (Bruce Momjian <bruce@momjian.us>)
List pgsql-performance
I wrote:
> Looking at this, I wonder if there isn't a bug or at least an
> inefficiency in 8.1.  The KeysEqual short circuit tests are still there
> in ri_triggers.c; aren't they now redundant with the test in triggers.c?
> And don't they need to account for the special case mentioned in the
> comment in triggers.c, that the RI check must still be done if we are
> looking at a row updated by the same transaction that created it?

OK, I take back the possible-bug comment: the special case only applies
to the FK-side triggers, which is to say RI_FKey_check, and that routine
doesn't attempt to skip the check on equal old/new keys.  I'm still
wondering though if the KeysEqual tests in the other RI triggers aren't
now a waste of cycles.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Effects of cascading references in foreign keys
Next
From: "Thomas F. O'Connell"
Date:
Subject: Re: Effects of cascading references in foreign keys