Re: cache type info in json_agg and friends - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: cache type info in json_agg and friends
Date
Msg-id 55FB4810.5050905@dunslane.net
Whole thread Raw
In response to Re: cache type info in json_agg and friends  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers

On 09/14/2015 03:41 PM, Alvaro Herrera wrote:
> Andrew Dunstan wrote:
>
>> Currently, json_agg, jsonb_agg, json_object_agg and jsonb_object_agg do type
>> classification on their arguments on each call to the transition function.
>> This is quite unnecessary, as the argument types won't change. This patch
>> remedies the defect by caching the necessary values in the aggregate state
>> object.
> Seems a reasonable idea to me.  This is 9.6 only, right?


I think we can reasonably backpatch it to 9.5, which is where the jsonb 
functions were actually introduced. It's not at all user visible, and 
we're still in alpha. Seem fair?

I have addressed your stylistic concerns, but I'll leave the fmgr_info 
question Teodor raised for another day. Before I do anything more than 
this I want to do some profiling to find out where the time is actually 
going for various workloads.

cheers

andrew



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: numbering plan nodes
Next
From: Robert Haas
Date:
Subject: Re: numbering plan nodes