Re: jsonb and nested hstore

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Oleg Bartunov <obartunov(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb and nested hstore
Date: 2014-02-05 16:33:25
Message-ID: CAHyXU0xdn+ko6GfwbL4OxiAjgaz6PAkvo71otGYBH3FdU88TZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 5, 2014 at 10:22 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> I'm actually surprised we have an alternate binary wire format for
>> jsonb at all; json is explicitly text and I'm not sure what the use
>> case of sending the internal structure is. Meaning, maybe jsonb
>> send/recv should be a thin wrapper to sending the json string. The
>> hstore send/recv I think properly covers the case where client side
>> binary wire format actors would want to manage performance critical
>> cases that want to avoid parsing.
>
> The whole reason we have jsonb is to avoid reparsing where possible

Sure; but on the server side. The wire format is for handling client
concerns. For example, the case you're arguing for would be for libpq
client to extract as jsonb as binary, manipulate it on a binary level,
then send it back as binary. I find this case to be something of a
stretch.

That being said, for binary dump/restore perhaps there's a performance
case to be made.

> In fact, I'd rather have the send and recv functions in the jsonb code and have
> hstore's functions call them, so we don't duplicate code.

yeah. Agree that there needs to be two sets of routines, not three.
I think a case could be made for the jsonb type could take either
json's or hstore's depending on if the above. FWIW, either way is
fine.

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-02-05 16:37:37 Re: Misaligned BufferDescriptors causing major performance problems on AMD
Previous Message Andrew Dunstan 2014-02-05 16:29:44 Re: jsonb and nested hstore