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 BA7015E37CE for ; Fri, 13 Aug 2004 11:54:27 -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 84099-05 for ; Fri, 13 Aug 2004 14:54:27 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id B79185E3639 for ; Fri, 13 Aug 2004 11:54:24 -0300 (ADT) Received: (qmail 2276 invoked by uid 500); 13 Aug 2004 15:02:43 -0000 Date: Fri, 13 Aug 2004 10:02:43 -0500 From: Bruno Wolff III To: Rod Taylor Cc: Ulrich Wisser , gnari , Postgresql Performance Subject: Re: insert Message-ID: <20040813150243.GA2004@wolff.to> Mail-Followup-To: Rod Taylor , Ulrich Wisser , gnari , Postgresql Performance References: <20040813111649.7B4116C4F8@tino.sinectis.com.ar> <00cc01c4812b$4e7f02e0$0100000a@wp2000> <411CAFA3.90005@relevanttraffic.se> <1092401876.16087.236.camel@jester> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1092401876.16087.236.camel@jester> 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/205 X-Sequence-Number: 7841 On Fri, Aug 13, 2004 at 08:57:56 -0400, Rod Taylor wrote: > On Fri, 2004-08-13 at 08:10, Ulrich Wisser wrote: > > Hi, > > > > my inserts are done in one transaction, but due to some foreign key > > constraints and five indexes sometimes the 100 inserts will take more > > than 5 minutes. > > 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 the type mismatch suggestion is probably what the problem is. The current solution is to make the types match. In 8.0.0 it would probably work efficiently as is, though it isn't normal for foreign keys to have a type mismatch and he may want to change that anyway.