Re: possible memory leak with SRFs

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: possible memory leak with SRFs
Date: 2010-05-08 16:44:03
Message-ID: 4BE594D3.8030609@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/08/2010 09:12 AM, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>> I think this is an example of why we still need to implement a real
>> SFRM_ValuePerCall mode that allows results to be pipelined. Yes,
>> ValuePerCall sort of works from the targetlist, but it is pretty much
>> useless for the use cases where people really want to use it.
>
>> Or would a FROM clause ValuePerCall suffer the same issue?
>
> I don't think it'd be a big problem. We could use the technique
> suggested in the comments in ExecMakeTableFunctionResult: use a separate
> memory context for evaluating the arguments than for evaluating the
> function itself. This will work in FROM because we can insist the SRF
> be at top level. The problem with SRFs in tlists is that they can be
> anywhere and there can be more than one, so it's too hard to keep track
> of what to reset when.

That's what I was thinking. I saw your other email about LATERAL for 9.1
-- would it be helpful for me to work on this issue for 9.1? After all,
about 7 years ago I said I'd do it ;-). Or do you think it will be an
integral part of the LATERAL work?

Joe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-05-08 16:54:04 Re: possible memory leak with SRFs
Previous Message Tom Lane 2010-05-08 16:12:16 Re: possible memory leak with SRFs