Copying large tables with DBLink
Copying large tables with DBLink
От:
"Chris Hoover" <revoohc@sermonaudio.com>
Дата:
Has anyone had problems with memory exhaustion and dblink? We were trying to use dblink to convert our databases to our new layout, and had our test server lock up several times when trying to copy a table that was significantly larger than our memory and swap. Basically where were doing an insert into
Re: Copying large tables with DBLink
От:
Joe Conway <mail@joeconway.com>
Дата:
Chris Hoover wrote: > Has anyone had problems with memory exhaustion and dblink? We were > trying to use dblink to convert our databases to our new layout, and had > our test server lock up several times when trying to copy a table that > was significantly larger than our memory and swap. > Basically where were doing an insert into
Re: Copying large tables with DBLink
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Chris Hoover" writes: > Has anyone had problems with memory exhaustion and dblink? We were > trying to use dblink to convert our databases to our new layout, and had > our test server lock up several times when trying to copy a table that > was significantly larger than our memory and swap. You're not going to be able to do that with dblink, nor any other set-returning function, because the current implementation of SRFs always materializes the entire function result in temporary memory/swap. Consider something like pg_dump -t srctab srcdb | psql destdb instead. regards, tom lane
Re: Copying large tables with DBLink
От:
Michael Fuhr <mike@fuhr.org>
Дата:
On Thu, Mar 24, 2005 at 01:59:44PM -0500, Chris Hoover wrote: > > Has anyone had problems with memory exhaustion and dblink? We were > trying to use dblink to convert our databases to our new layout, and had > our test server lock up several times when trying to copy a table that > was significantly larger than our memory and swap. Hmmm...doesn't dblink use libpq, and doesn't libpq fetch the entire result set before doing anything with it? If so, then that could explain the memory exhaustion. > Basically where were doing an insert into