Re: Progress report: intraquery memory recovery in executor - Mailing list pgsql-hackers

From Philip Warner
Subject Re: Progress report: intraquery memory recovery in executor
Date
Msg-id 3.0.5.32.20000711003031.0251a300@mail.rhyme.com.au
Whole thread Raw
In response to Re: Progress report: intraquery memory recovery in executor  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Progress report: intraquery memory recovery in executor  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At 10:08 10/07/00 -0400, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.au> writes:
>> Is it simple for the person writing the low level routines to choose
>> (easily) to allocate 'temporary' memory vs. 'permanent' memory?
>
>One of the main problems is that a low-level routine doesn't necessarily
>know which is appropriate --- the answer may vary depending on where it
>was called from.  
...
>That's why I wanted to do the management at the level of the Plan node
>executor routines, which are high-level enough that they have some clue
>what's going on.

ISTM (with, perhaps, no basis (ISTMWPNB?)) that when allocating memory
there are a couple of cases:

You want it to be available:

1. until the end of the current call
2. at least until the next call
3. until TX end
4. forever
...etc.

If there are still cases where the called routine can't tell what sort of
memory it wants, then my method won't work (and I'd be interested to know
what they are).

But if a relatively short list of allocation types can be created, then the
palloc replacement can be passed an extra parameter (the 'allocation
type'), and handle memory contexts appropriately.

Feel free to tell me if this is so way off the mark that there is no
purpose in pursuing the discussion...


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 008 659 498)             |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [GENERAL] PostgreSQL vs. MySQL
Next
From: Tom Lane
Date:
Subject: Re: more corruption