Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document - Mailing list pgsql-bugs

From Andres Freund
Subject Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document
Date
Msg-id 20171007024205.3p6idiqexbmik4cs@alap3.anarazel.de
Whole thread Raw
In response to Re: [BUGS] json(b)_array_elements use causes very large memory usage when also referencing entire json document  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
On 2017-10-06 22:35:37 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I've just played around with this. ValuePerCall SRFs are fine with
> > called in a short-lived context (they're required to be able to, as
> > documented in xfunc.sgml), so is SFRM_Materialize. The only thing to be
> > careful about is the *arguments* to the function, those need to live
> > long enough in the ValuePerCall case.
> 
> Isn't there already code to deal with that?  See around line 175
> in execSRF.c.

Well, that's for nodeFunctionscan.c, not nodeProjectSet.c. But it seems
quite sensible to model this very similarly.

I'd still like to unify those two functions, but given that
ExecMakeTableFunctionResult materializes ValuePerCall SRFs, that doesn't
seem likely.

Greetings,

Andres Freund


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] json(b)_array_elements use causes very large memory usage when also referencing entire json document
Next
From: Andres Freund
Date:
Subject: Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document