X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BDF6C9DCB52 for ; Wed, 7 Dec 2005 00:41:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33770-08 for ; Wed, 7 Dec 2005 00:41:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by postgresql.org (Postfix) with ESMTP id 6B0A39DCB44 for ; Wed, 7 Dec 2005 00:41:33 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id jB74fGY21078; Tue, 6 Dec 2005 23:41:16 -0500 (EST) From: Bruce Momjian Message-Id: <200512070441.jB74fGY21078@candle.pha.pa.us> Subject: Re: Effects of cascading references in foreign keys In-Reply-To: <12097.1130610925@sss.pgh.pa.us> To: Tom Lane Date: Tue, 6 Dec 2005 23:41:16 -0500 (EST) CC: Michael Fuhr , Bruno Wolff III , Martin Lesser , Stephan Szabo , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200512/220 X-Sequence-Number: 16041 Would someone add a comment in the code about this, or research it? --------------------------------------------------------------------------- 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. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073