Re: insert

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Ulrich Wisser <ulrich(dot)wisser(at)relevanttraffic(dot)se>
Cc: "pgsql-performance (at) postgresql (dot) org" <pgsql-performance(at)postgresql(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: insert
Date: 2004-08-13 12:41:15
Message-ID: 20040813134115.A12181@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On 13/08/2004 13: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.

Two possibilities come to mind:

a) you need an index on the referenced FK field
b) you have an index but a type mis-match (e.g, an int4 field referencing
an int8 field)

Either of these will cause a sequential table scan and poor performance.

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

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

Browse pgsql-performance by date

  From Date Subject
Next Message Rod Taylor 2004-08-13 12:57:56 Re: insert
Previous Message Ulrich Wisser 2004-08-13 12:10:11 Re: insert