Re: slow update

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: slow update
Date: 2002-07-26 14:46:13
Message-ID: 20020726104613.D18001@mail.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 26, 2002 at 03:14:37PM +0200, Janning Vygen wrote:
>
> UPDATE real
> SET val1=(SELECT val1 FROM temp WHERE temp.id = real.id ),
> val2=(SELECT val2 FROM temp WHERE temp.id = real.id )
> WHERE id IN (SELECT temp.id FROM temp);

Ick. IN is a well-known dog in Postgres. Try this:

UPDATE real
SET val1=temp.val1,val2=temp.val2
WHERE id=temp.id;

A

--
----
Andrew Sullivan 87 Mowat Avenue
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M6K 3E3
+1 416 646 3304 x110

In response to

  • slow update at 2002-07-26 13:14:37 from Janning Vygen

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-26 14:57:39 Re: Bad HTML in Mail List Archives
Previous Message Robert Treat 2002-07-26 14:44:11 Re: Bad HTML in Mail List Archives