Bulk update of large database

Поиск
Список
Период
Сортировка
От Martin Weinberg
Тема Bulk update of large database
Дата
Msg-id 199911201604.LAA25365@osprey.astro.umass.edu
обсуждение исходный текст
Ответы Re: [HACKERS] Bulk update of large database  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "C.S.Park"
Дата:
Сообщение: [q] can I simply remove pg_log file?
Следующее
От: "Andrij Korud"
Дата:
Сообщение: C++ and SPI