backend grows during cursor/select/fetch (memory leak?) - Mailing list pgsql-general

From Jim Mercer
Subject backend grows during cursor/select/fetch (memory leak?)
Date
Msg-id 20000104170822.M4188@reptiles.org
Whole thread Raw
List 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@reptiles.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.  ]

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Future of PostgreSQL
Next
From: Charles Martin
Date:
Subject: please help me recover from duplicate key in unique index