Re: Major Performance issue - Mailing list pgsql-general

From Tom Lane
Subject Re: Major Performance issue
Date
Msg-id 3503.1111909747@sss.pgh.pa.us
Whole thread Raw
In response to Major Performance issue  (John Hughes <jondo2010@gmail.com>)
List pgsql-general
John Hughes <jondo2010@gmail.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

pgsql-general by date:

Previous
From: Dan Sugalski
Date:
Subject: Re: Perl and AutoCommit
Next
From: Michael Fuhr
Date:
Subject: Re: Debugging deadlocks