Re: Major Performance issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Hughes <jondo2010(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Major Performance issue
Date: 2005-03-27 07:49:07
Message-ID: 3503.1111909747@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John Hughes <jondo2010(at)gmail(dot)com> writes:
> The problem is that inserting into temp_holding takes more than a SECOND PER
> ROW!

Offhand I'd bet on the repeated computations of max(core_leads.id) as
being the bulk of the problem. That's completely broken anyway since
if concurrent insertions are happening there's no guarantee you'll
get the same result each time. Consider using a sequence to
generate these IDs, and doing just one nextval() not several per
trigger call.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-03-27 08:37:44 Re: Debugging deadlocks
Previous Message Dan Sugalski 2005-03-27 07:40:34 Re: Perl and AutoCommit