Performance Problem

From: Adam Sherman <adam(at)tritus(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Performance Problem
Date: 2003-05-12 13:57:12
Message-ID: 62900000.1052747832@saturn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to isolate a performance problem I'm having.

I have some code that does something like this, iterating through a list:

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.

Thanks,

A.

--
Adam Sherman
Tritus CG Inc.
http://www.tritus.ca/
+1 (613) 797-6819

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-05-12 13:58:31 Re: Caching Websites
Previous Message Tom Lane 2003-05-12 13:53:43 Re: Error installing postgresql-7.3.2 (fixed, but Q remains...)