X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6DE325E37CE for ; Fri, 13 Aug 2004 13:23:23 -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 08839-09 for ; Fri, 13 Aug 2004 16:23:24 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 04BD45E46E1 for ; Fri, 13 Aug 2004 13:23:15 -0300 (ADT) Received: (qmail 3862 invoked by uid 500); 13 Aug 2004 16:31:34 -0000 Date: Fri, 13 Aug 2004 11:31:34 -0500 From: Bruno Wolff III To: Matt Clark Cc: 'Rod Taylor' , 'Ulrich Wisser' , 'gnari' , 'Postgresql Performance' Subject: Re: insert Message-ID: <20040813163134.GA3743@wolff.to> Mail-Followup-To: Matt Clark , 'Rod Taylor' , 'Ulrich Wisser' , 'gnari' , 'Postgresql Performance' References: <20040813150243.GA2004@wolff.to> <006901c48150$fcfafb10$8300a8c0@solent> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006901c48150$fcfafb10$8300a8c0@solent> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/211 X-Sequence-Number: 7847 On Fri, Aug 13, 2004 at 17:17:10 +0100, Matt Clark wrote: > > > It is likely that you are missing an index on one of those foreign > > > key'd items. > > > > I don't think that is too likely as a foreign key reference > > must be a unique key which would have an index. > > I think you must be thinking of primary keys, not foreign keys. All > one-to-many relationships have non-unique foreign keys. The target of the reference needs to have at least a unique index. I am not sure if it needs to actually be declared as either a unique or primary key, though that is the intention. The records doing the referencing don't need (and normally aren't) unique.