Re: insert - Mailing list pgsql-performance

From Paul Thomas
Subject Re: insert
Date
Msg-id 20040813134115.A12181@bacon
Whole thread Raw
In response to Re: insert  (Ulrich Wisser <ulrich.wisser@relevanttraffic.se>)
List 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   |
+------------------------------+---------------------------------------------+

pgsql-performance by date:

Previous
From: Ulrich Wisser
Date:
Subject: Re: insert
Next
From: Rod Taylor
Date:
Subject: Re: insert