Re: insert

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Ulrich Wisser <ulrich(dot)wisser(at)relevanttraffic(dot)se>
Cc: gnari <gnari(at)simnet(dot)is>, Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: insert
Date: 2004-08-13 12:57:56
Message-ID: 1092401876.16087.236.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

In response to

  • Re: insert at 2004-08-13 12:10:11 from Ulrich Wisser

Responses

  • Re: insert at 2004-08-13 15:02:43 from Bruno Wolff III

Browse pgsql-performance by date

  From Date Subject
Next Message Arash Zaryoun 2004-08-13 14:43:43 Weird Database Performance problem!
Previous Message Paul Thomas 2004-08-13 12:41:15 Re: insert