Search Postgresql Archives

Please help to speed up UPDATE statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux