pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Adam Sherman <adam@tritus.ca>
Cc: pgsql-general@postgresql.org
Subject: Re: Performance Problem
Date: Mon, 12 May 2003 10:42:43 -0500
Message-ID: <20030512154243.GA5758@wolff.to> (raw)
In-Reply-To: <62900000.1052747832@saturn>
References: <62900000.1052747832@saturn>

On Mon, May 12, 2003 at 09:57:12 -0400,
  Adam Sherman <adam@tritus.ca> wrote:
> 
> BEGIN
> while(list)
> lookup for existing entry (SELECT)
> if not, INSERT
> if yes, UPDATE
> log a message
> COMMIT
> 
> With approx. 30K items the process takes way too long. On the order of 10+ 
> minutes.
> 
> I notice that the process seems to slow down as it completes more and more 
> items. ie, the first 10K takes just a few moments while the last 10K takes 
> most of the time. Note that I'm running test where the only existing 
> entries will have been inserted in the same transaction.
> 
> I need to know if the bottleneck is PG or higher up so I can go hunting 
> there.

Are there deferred constraints? They are still order n squared. Some
fixes went in to 7.3 but the last order n squared issue wasn't fixed
until 7.4. There was some discussion of back porting the fix to 7.3.3
(which might be available in about a month) but I am not sure whether
or that is going to happen.




view thread (47+ messages)  latest in thread

Message-ID: <20030512154243.GA5758@wolff.to>
Permalink:  ../20030512154243.GA5758@wolff.to/
Also on:    postgresql.org/message-id/20030512154243.GA5758@wolff.to

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruno@wolff.to, adam@tritus.ca
  Subject: Re: Performance Problem
  In-Reply-To: <20030512154243.GA5758@wolff.to>
  References: <62900000.1052747832@saturn> <20030512154243.GA5758@wolff.to>

* 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