Re: Effects of cascading references in foreign keys

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Bruno Wolff III <bruno(at)wolff(dot)to>, Martin Lesser <ml-pgsql(at)bettercom(dot)de>, Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Effects of cascading references in foreign keys
Date: 2006-08-22 03:50:02
Message-ID: 200608220350.k7M3o2s14894@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane wrote:
> 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.

Would someone please research this? Thanks.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dan Langille 2006-08-22 09:09:36 Forcing index usage without 'enable_hashjoin = FALSE'
Previous Message Joshua D. Drake 2006-08-22 01:55:50 Re: Vacuum not identifying rows for removal..