Bulk update of large database - Mailing list pgsql-hackers

From Martin Weinberg
Subject Bulk update of large database
Date
Msg-id 199911201604.LAA25365@osprey.astro.umass.edu
Whole thread Raw
Responses Re: [HACKERS] Bulk update of large database  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I have two tables of roughly 200,000,000 records and want
to update one column in one of the tables according to
values in the second table using a unique key.

For example:
update table1 set x=1 from table2 where        exists (select * from table2 table1.key=table2.key);

(or using an IN clause or using a straight join but EXPLAIN tells me
that the latter is much slower).

This does work but appends the updates (until the next vacuum). 
For a  100GB database, this is too large of a storage overhead.  
Is there another good way?  I've searched the newsgroups, docs and 
books without a clue . . .

Thanks much,

--Martin

===========================================================================

Martin Weinberg                      Phone: (413) 545-3821
Dept. of Physics and Astronomy       FAX:   (413) 545-2117/0648
530 Graduate Research Tower         weinberg@astro.umass.edu
University of Massachusetts         http://www.astro.umass.edu/~weinberg/
Amherst, MA  01003-4525


pgsql-hackers by date:

Previous
From: "C.S.Park"
Date:
Subject: [q] can I simply remove pg_log file?
Next
From: "Andrij Korud"
Date:
Subject: C++ and SPI