pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Thomas <paul@tmsl.demon.co.uk>
To: Ulrich Wisser <ulrich.wisser@relevanttraffic.se>
Cc: pgsql-performance @ postgresql . org <pgsql-performance@postgresql.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: insert
Date: Fri, 13 Aug 2004 13:41:15 +0100
Message-ID: <20040813134115.A12181@bacon> (raw)
In-Reply-To: <411CAFA3.90005@relevanttraffic.se>
References: <20040813111649.7B4116C4F8@tino.sinectis.com.ar>
	<00cc01c4812b$4e7f02e0$0100000a@wp2000>
	<411CAFA3.90005@relevanttraffic.se>


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   |
+------------------------------+---------------------------------------------+



view thread (19+ messages)  latest in thread

Message-ID: <20040813134115.A12181@bacon>
Permalink:  ../20040813134115.A12181@bacon/
Also on:    postgresql.org/message-id/20040813134115.A12181@bacon

 · 

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: paul@tmsl.demon.co.uk, ulrich.wisser@relevanttraffic.se
  Subject: Re: insert
  In-Reply-To: <20040813134115.A12181@bacon>

* 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