pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Fuhr <mike@fuhr.org>
Cc: Bruno Wolff III <bruno@wolff.to>
Cc: Martin Lesser <ml-pgsql@bettercom.de>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Effects of cascading references in foreign keys
Date: Sat, 29 Oct 2005 14:35:25 -0400
Message-ID: <12097.1130610925@sss.pgh.pa.us> (raw)
In-Reply-To: <11904.1130608918@sss.pgh.pa.us>
References: <87acgszihk.fsf@nb-aspire.bettercom.de>
	<20051029142432.GA79557@winnie.fuhr.org>
	<20051029144947.GB21068@wolff.to>
	<20051029160527.GA80135@winnie.fuhr.org>
	<11904.1130608918@sss.pgh.pa.us>

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



view thread (17+ messages)  latest in thread

Message-ID: <12097.1130610925@sss.pgh.pa.us>
Permalink:  ../12097.1130610925@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12097.1130610925@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mike@fuhr.org, bruno@wolff.to, ml-pgsql@bettercom.de, sszabo@megazone.bigpanda.com
  Subject: Re: Effects of cascading references in foreign keys
  In-Reply-To: <12097.1130610925@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox