Re: [HACKERS] bugfix patch for json_array_elements

2014-02-03 Thread Andrew Dunstan
On 02/03/2014 11:12 AM, Tom Lane wrote: Andrew Dunstan writes: On 02/02/2014 08:54 PM, Craig Ringer wrote: The attached patch deletes the context after use, bringing performance back into line. It should be backpatched to 9.3. Hmm. I guess I was assuming that the tmp_cxt would be cleaned up

Re: [HACKERS] bugfix patch for json_array_elements

2014-02-03 Thread Tom Lane
Andrew Dunstan writes: > On 02/02/2014 08:54 PM, Craig Ringer wrote: >> The attached patch deletes the context after use, bringing performance >> back into line. It should be backpatched to 9.3. > Hmm. I guess I was assuming that the tmp_cxt would be cleaned up at the > end of the function since

Re: [HACKERS] bugfix patch for json_array_elements

2014-02-03 Thread Andrew Dunstan
On 02/02/2014 08:54 PM, Craig Ringer wrote: On 02/03/2014 09:09 AM, Craig Ringer wrote: At a guess, we're looking at a case where a new child context is created at every call, so every MemoryContextResetChildren call has to deal with more child contexts. That would be "yes". After a short run

Re: [HACKERS] bugfix patch for json_array_elements

2014-02-02 Thread Craig Ringer
On 02/03/2014 09:09 AM, Craig Ringer wrote: > At a guess, we're looking at a case where a new child context is created > at every call, so every MemoryContextResetChildren call has to deal with > more child contexts. That would be "yes". After a short run, I see 32849 lines like: json_array_elem