X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 89AF59FA10A for ; Wed, 14 Jun 2006 19:13:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 79963-03 for ; Wed, 14 Jun 2006 19:13:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id B71EC9FA4A8 for ; Wed, 14 Jun 2006 19:13:22 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k5EMCm204045; Wed, 14 Jun 2006 18:12:48 -0400 (EDT) From: Bruce Momjian Message-Id: <200606142212.k5EMCm204045@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: Wed, 14 Jun 2006 18:12:48 -0400 (EDT) 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: Maia Mailguard 1.0.1 X-Archive-Number: 200606/281 X-Sequence-Number: 19638 Would someone please find the answer to Tom's last question? --------------------------------------------------------------------------- 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 EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +