pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <pg@rbt.ca>
To: Ulrich Wisser <ulrich.wisser@relevanttraffic.se>
Cc: gnari <gnari@simnet.is>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: insert
Date: Fri, 13 Aug 2004 08:57:56 -0400
Message-ID: <1092401876.16087.236.camel@jester> (raw)
In-Reply-To: <411CAFA3.90005@relevanttraffic.se>
References: <20040813111649.7B4116C4F8@tino.sinectis.com.ar>
	<00cc01c4812b$4e7f02e0$0100000a@wp2000>
	<411CAFA3.90005@relevanttraffic.se>

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 =
'<insert value>';

Fix them until they're quick.





view thread (19+ messages)  latest in thread

Message-ID: <1092401876.16087.236.camel@jester>
Permalink:  ../1092401876.16087.236.camel@jester/
Also on:    postgresql.org/message-id/1092401876.16087.236.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pg@rbt.ca, ulrich.wisser@relevanttraffic.se, gnari@simnet.is
  Subject: Re: insert
  In-Reply-To: <1092401876.16087.236.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox