Re: [HACKERS] cache type info in json_agg and friends

2015-09-17 Thread Andrew Dunstan
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

Re: [HACKERS] cache type info in json_agg and friends

2015-09-15 Thread Andrew Dunstan
On 09/14/2015 04:24 PM, Andrew Dunstan wrote: On 09/14/2015 03:42 PM, Teodor Sigaev 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

Re: [HACKERS] cache type info in json_agg and friends

2015-09-14 Thread Andrew Dunstan
On 09/14/2015 03:42 PM, Teodor Sigaev 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

Re: [HACKERS] cache type info in json_agg and friends

2015-09-14 Thread Teodor Sigaev
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

Re: [HACKERS] cache type info in json_agg and friends

2015-09-14 Thread Alvaro Herrera
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

[HACKERS] cache type info in json_agg and friends

2015-09-14 Thread Andrew Dunstan
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