Re: Another weird one with an UPDATE

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: David Griffiths <dgriffiths(at)boats(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Another weird one with an UPDATE
Date: 2003-10-13 01:48:24
Message-ID: 20031012184536.N5307@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, 12 Oct 2003, David Griffiths wrote:

> [snip]
>
> > I think you want something like:
> > UPDATE user_account SET last_name = 'abc'
> > WHERE EXISTS (SELECT 1 FROM commercial_entity ce, commercial_service cs
> > WHERE user_account.user_account_id = ce.user_account_id AND
> > ce.commercial_entity_id = cs.commercial_entity_id);
>
> Unfort, this is still taking a long time.

Hmm, does
UPDATE user_account SET last_name='abc'
FROM commercial_entity ce, commercial_service cs
WHERE user_account.user_account_id = ce.user_account_id AND
ce.commercial_entity_id=cs.commercial_entity_id;
give the right results... That might end up being faster.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message pginfo 2003-10-13 05:01:26 Re: go for a script! / ex: PostgreSQL vs. MySQL
Previous Message Joe Conway 2003-10-13 01:37:18 Re: Another weird one with an UPDATE