Re: slow update

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Chad Thompson <chad(at)weblinkservices(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: slow update
Date: 2003-04-30 17:33:03
Message-ID: 20030430173303.GA8964@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Apr 30, 2003 at 10:12:35 -0600,
Chad Thompson <chad(at)weblinkservices(dot)com> wrote:
> Hey guys/gals
> I have a update that is slow and I cant get my head around a way to make it
> faster.
>
> update table set id = '555'
> where id in (select id from different_table)
>
> pretty simple... i tried using exists as well.. but it still seems to be
> very slow.

This will probably run faster in 7.4 as "in" has been improved.

If id is a unique column in different table, then you might try the following:
update table set id = '555' from different_table where table.id =
different_table.id

In response to

  • slow update at 2003-04-30 16:12:35 from Chad Thompson

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message radha.manohar 2003-04-30 18:21:15 Re: Debug option
Previous Message Chad Thompson 2003-04-30 16:12:35 slow update