Re: slow update - Mailing list pgsql-general

From Janning Vygen
Subject Re: slow update
Date
Msg-id 200207261712.g6QHCaM03037@janning.planwerk6.local
Whole thread Raw
In response to Re: slow update  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-general
Am Freitag, 26. Juli 2002 16:46 schrieb Andrew Sullivan:
> 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;

oh thanks a lot! this is MUCH faster! but it occurs another problem...
.. but this should be posted in another thread...

kind regards
janning

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Advice on geolocation
Next
From: Janning Vygen
Date:
Subject: plpgsql: function throws error on second call!