X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2DA3FD1B446 for ; Mon, 5 Jan 2004 19:49:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48421-06 for ; Mon, 5 Jan 2004 15:48:25 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 8E367D1B44B for ; Mon, 5 Jan 2004 15:48:25 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 8352B3563A; Mon, 5 Jan 2004 11:48:26 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 822A235632; Mon, 5 Jan 2004 11:48:26 -0800 (PST) Date: Mon, 5 Jan 2004 11:48:26 -0800 (PST) From: Stephan Szabo To: Vivek Khera Cc: pgsql-performance@postgresql.org Subject: Re: deferred foreign keys In-Reply-To: Message-ID: <20040105114730.U73612@megazone.bigpanda.com> References: <3FF4FA25.7050802@familyhealth.com.au> <20040105183859.GA28448@wolff.to> <20040105105401.C72490@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/49 X-Sequence-Number: 5224 On Mon, 5 Jan 2004, Vivek Khera wrote: > > On Jan 5, 2004, at 1:57 PM, Stephan Szabo wrote: > > > But, if he's updating the fk table but not the keyed column, it should > > no > > longer be doing the check and grabbing the locks. If he's seeing it > > grab > > the row locks still a full test case would be handy because it'd > > probably > > mean we missed something. > > > > I'm not *sure* it is taking any locks. The transactions appear to be > running lock step (operating on different parts of the same pair of > tables) and I was going to see if deferring the locks made the > difference. It is my feeling now that it will not. However, if there > is a way to detect if locks are being taken, I'll do that. I'd like to > avoid dropping and recreating the foreign keys if I can since it takes > up some bit of time on the table with 20+ million rows. The only way I can think of to see the locks is to do just one of the operations and then manually attempting to select for update the associated pk row.