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 C04E95E37CE for ; Fri, 13 Aug 2004 09:58:02 -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 49902-04 for ; Fri, 13 Aug 2004 12:57:58 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id B8CF75E37CB for ; Fri, 13 Aug 2004 09:57:53 -0300 (ADT) Received: from [134.22.70.202] (dyn-70-202.tor.dsl.tht.net [134.22.70.202]) by tht.net (Postfix) with ESMTP id 140D076BD3; Fri, 13 Aug 2004 08:57:59 -0400 (EDT) Subject: Re: insert From: Rod Taylor To: Ulrich Wisser Cc: gnari , Postgresql Performance In-Reply-To: <411CAFA3.90005@relevanttraffic.se> References: <20040813111649.7B4116C4F8@tino.sinectis.com.ar> <00cc01c4812b$4e7f02e0$0100000a@wp2000> <411CAFA3.90005@relevanttraffic.se> Content-Type: text/plain Message-Id: <1092401876.16087.236.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 13 Aug 2004 08:57:56 -0400 Content-Transfer-Encoding: 7bit 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/203 X-Sequence-Number: 7839 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. Do an EXPLAIN ANALYZE SELECT * FROM foreign_table WHERE foreign_col = ''; Fix them until they're quick.