Please help to speed up UPDATE statement

From: "Andrus" <noeetasoftspam(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Please help to speed up UPDATE statement
Date: 2005-04-12 14:40:56
Message-ID: d3gmlt$gm8$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Parker 2005-04-12 14:51:09 client interfaces
Previous Message Jeff Eckermann 2005-04-12 14:32:05 Re: Crystal reports 9 fails to recognise data on upgrade to 8.0.1