Re: UPDATE on two large datasets is very slow

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tommy Gildseth <tommy(at)gildseth(dot)com>
Cc: ocean(at)ocean(dot)fraknet(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE on two large datasets is very slow
Date: 2007-04-04 15:24:32
Message-ID: 20070404152432.GE22542@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 04, 2007 at 11:34:22AM +0200, Tommy Gildseth wrote:
> >For the record, this is what the SQL MERGE command is for... I don't
> >think anyone is working on implementing that though...
> >
> This will possibly provide a solution to this question:
> http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE

Almost. Merge will allow you to combine the INSERT and UPDATE into a
single command. It doesn't avoid the race condition though, so you
still need the exception block and the loop.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pobox@verysmall.org 2007-04-04 17:02:46 Re: use superuser connection from php
Previous Message Froggy / Froggy Corp. 2007-04-04 14:51:57 Re: Problem with a transaction on dump