Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] Prevent pg_dump running out of memory

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Prevent pg_dump running out of memory
Date: 2001-08-28 02:15:05
Message-ID: 20010828121504.A2731@svana.org (view raw or flat)
Thread:
Lists: pgsql-patches
On Mon, Aug 27, 2001 at 04:36:50PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)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(at)svana(dot)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.

In response to

pgsql-patches by date

Next:From: Barry LindDate: 2001-08-28 05:48:33
Subject: Re: [PATCHES] Attempt to clean up ExecSql() in JDBC
Previous:From: Tom LaneDate: 2001-08-27 23:56:30
Subject: Expect slow response this week

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group