Re: Please help to speed up UPDATE statement

From: Bob Henkel <luckyratfoot(at)gmail(dot)com>
To: Andrus <noeetasoftspam(at)online(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Please help to speed up UPDATE statement
Date: 2005-04-12 17:56:33
Message-ID: 762e5c050412105613f5def1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Apr 12, 2005 9:40 AM, Andrus <noeetasoftspam(at)online(dot)ee> wrote:
>
> The following statement runs VERY slowly on large tables.
>
> Any idea how to speed it up ?
>
> UPDATE rid SET dokumnr=NULL WHERE
> dokumnr NOT IN (SELECT dokumnr FROM dok);
>
> Tables:
>
> CREATE TABLE dok ( dokumnr INTEGER,
> CONSTRAINT dok_pkey PRIMARY KEY (dokumnr) );
>
> CREATE TABLE rid ( dokumnr INTEGER );
> CREATE INDEX rid_dokumnr_idx ON rid (dokumnr);
>
> Andrus
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

Please send your explain plan everyone will want to see it to tell what is
going on.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PFC 2005-04-12 18:34:36 Re: pg 8.0.1-r3 killls pgadmin3 and phppgadmin
Previous Message Mark Harrison 2005-04-12 17:51:51 generating a parent/child relationship in a trigger