backend grows during cursor/select/fetch (memory leak?)

From: Jim Mercer <jim(at)reptiles(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: backend grows during cursor/select/fetch (memory leak?)
Date: 2000-01-04 22:08:22
Message-ID: 20000104170822.M4188@reptiles.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


i have a table like:

CREATE TABLE testtbl
(
somestr varchar(20),
someint int4,
somedate abstime
);

it has some 6 million records in it.

if i do the following:

BEGIN WORK;
DECLARE cursorname CURSOR FOR SELECT somestr, someint, somedate FROM testtbl;
FETCH FORWARD 1000 IN cursorname;
(skip out and check the size of the backend process)
FETCH FORWARD 1000 IN cursorname;
FETCH FORWARD 1000 IN cursorname;
FETCH FORWARD 1000 IN cursorname;
(skip out and check the size of the backend process)
CLOSE cursorname;
END WORK;

the size of the backend grows to something, and doesn't grow much, or at all
between the first and second checks.

if the SELECT is changed to:

SELECT somestr, somedate, someint, somedate + timespan(someint)

the backend starts to grow, especially after fetching forward 10000 or so
records.

is this a memory leak?

is there another way to stage the query (basically adding seconds to a date for each record)?

this is on postgresql-6.5.3 on FreeBSD 3.x

--
[ Jim Mercer jim(at)reptiles(dot)org +1 416 506-0654 ]
[ Reptilian Research -- Longer Life through Colder Blood ]
[ Don't be fooled by cheap Finnish imitations; BSD is the One True Code. ]

Browse pgsql-general by date

  From Date Subject
Next Message Charles Martin 2000-01-04 23:28:41 please help me recover from duplicate key in unique index
Previous Message Tom Lane 2000-01-04 22:00:18 Re: [BUGS] problem creating index in 6,5,3