Re: cache type info in json_agg and friends

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: cache type info in json_agg and friends
Date: 2015-09-17 23:09:04
Message-ID: 55FB4810.5050905@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-09-17 23:20:23 Re: numbering plan nodes
Previous Message Simon Riggs 2015-09-17 21:19:10 Re: numbering plan nodes