Re: [PATCH] Prevent pg_dump running out of memory - Mailing list pgsql-patches

From Martijn van Oosterhout
Subject Re: [PATCH] Prevent pg_dump running out of memory
Date
Msg-id 20010828121504.A2731@svana.org
Whole thread Raw
In response to Re: [PATCH] Prevent pg_dump running out of memory  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Mon, Aug 27, 2001 at 04:36:50PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > This patch replaces the simple SELECT * with a cursor that fetches 1,000 rows
> > at a time. The 1,000 was chosen because it was small enough to test but I
> > think realisitically 10,000 wouldn't be too much.
>
> Applied.  However, I went the other way: I reduced the 1000 to 100.
> I doubt it'll make much difference in performance, and with TOAST
> available I can believe people might have multi-megabyte rows.

Good point. Just as long as you're not getting one row at a time it's a win.

> I also added a cursor CLOSE command, just to be a neatnik.  It's
> probably not critical given that the same cursor name is used each
> time, but still...

Doh! I even thought of that while writing it but I couldn't remember the
command. I tend to let cursors die at the end of the transaction.

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.

pgsql-patches by date:

Previous
From: Gerhard Häring
Date:
Subject: Re: Makefiles for building with mingw32 on win32
Next
From: Barry Lind
Date:
Subject: Re: Attempt to clean up ExecSql() in JDBC