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 46FA7DB330 for ; Sat, 29 Oct 2005 11:47:55 -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 61978-01 for ; Sat, 29 Oct 2005 14:47:51 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id A2BC0DB32D for ; Sat, 29 Oct 2005 11:47:53 -0300 (ADT) Received: (qmail 29239 invoked by uid 500); 29 Oct 2005 14:49:47 -0000 Date: Sat, 29 Oct 2005 09:49:47 -0500 From: Bruno Wolff III To: Michael Fuhr Cc: Martin Lesser , pgsql-performance@postgresql.org Subject: Re: Effects of cascading references in foreign keys Message-ID: <20051029144947.GB21068@wolff.to> Mail-Followup-To: Bruno Wolff III , Michael Fuhr , Martin Lesser , pgsql-performance@postgresql.org References: <87acgszihk.fsf@nb-aspire.bettercom.de> <20051029142432.GA79557@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051029142432.GA79557@winnie.fuhr.org> 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/453 X-Sequence-Number: 15221 On Sat, Oct 29, 2005 at 08:24:32 -0600, Michael Fuhr wrote: > > Does an UPDATE of e.g. m_fld1 in t_master cause a 'lookup' in all tables > > which have a cascading update-rule or is this 'lookup' only triggered if > > the referenced column in t_master is explicitly updated? > > My tests suggest that a lookup on the referring key is done only > if the referenced key is changed. Here's an example from 8.1beta4; > I used this version because EXPLAIN ANALYZE shows triggers and the > time spent in them, but I see similar performance characteristics > in earlier versions. I've intentionally not put an index on the > referring column to make lookups on it slow. It looks like this feature was added last May, so I think it only applies to 8.1.