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

From Tom Lane
Subject Re: Progress report: intraquery memory recovery in executor
Date
Msg-id 29989.963238138@sss.pgh.pa.us
Whole thread Raw
In response to Re: Progress report: intraquery memory recovery in executor  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: Progress report: intraquery memory recovery in executor  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
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.  To do it that way, I think we'd end up decorating a
large number of internal APIs with extra MemoryContext arguments.
(This is exactly why we have a global CurrentMemoryContext in the first
place...)

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: Re: postgres TODO
Next
From: Tom Lane
Date:
Subject: Re: Re: [BUGS] Unnexpected results using to_number()