Re: json(b)_array_elements use causes very large memory usage when also referencing entire json document

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Lucas Fairchild-Madar <lucas(dot)madar(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: json(b)_array_elements use causes very large memory usage when also referencing entire json document
Date: 2017-10-07 02:35:37
Message-ID: 7739.1507343737@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andres Freund <andres(at)anarazel(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2017-10-07 02:42:05 Re: json(b)_array_elements use causes very large memory usage when also referencing entire json document
Previous Message Andres Freund 2017-10-07 02:26:33 Re: json(b)_array_elements use causes very large memory usage when also referencing entire json document