X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 068A6D84AC for ; Sat, 29 Oct 2005 11:46:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48066-08 for ; Sat, 29 Oct 2005 14:46:38 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id DAB62D6F96 for ; Sat, 29 Oct 2005 11:46:39 -0300 (ADT) Received: (qmail 28906 invoked by uid 500); 29 Oct 2005 14:48:35 -0000 Date: Sat, 29 Oct 2005 09:48:35 -0500 From: Bruno Wolff III To: Martin Lesser Cc: pgsql-performance@postgresql.org Subject: Re: Effects of cascading references in foreign keys Message-ID: <20051029144835.GA21068@wolff.to> Mail-Followup-To: Bruno Wolff III , Martin Lesser , pgsql-performance@postgresql.org References: <87acgszihk.fsf@nb-aspire.bettercom.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87acgszihk.fsf@nb-aspire.bettercom.de> User-Agent: Mutt/1.4.2.1i 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: 200510/452 X-Sequence-Number: 15220 On Sat, Oct 29, 2005 at 13:10:31 +0200, Martin Lesser wrote: > Which effects have UPDATEs on REFERENCEd TABLEs when only columns in the > referenced table are updated which are not part of the FOREIGN KEY > constraint? In 8.1 there is a check to see if the foreign key value has changed and if not a trigger isn't queued. In the currently released versions any update will fire triggers. The check in comment for trigger.c didn't say if this optimization applied to both referencing and referenced keys or just one of those. If you need to know more you can look at the code at: http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/ for trigger.c.