Re: Duplicate JSON Object Keys

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Hannu Krosing <hannu(at)krosing(dot)net>
Cc: "David E(dot) Wheeler" <david(at)justatheory(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Hannu Krosing <hannu(at)2ndQuadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Duplicate JSON Object Keys
Date: 2013-03-09 00:25:03
Message-ID: 513A815F.8050500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 03/08/2013 06:37 PM, Hannu Krosing wrote:

>
> I suspect that 99.98% of the time we will get valid and unique JS
> Object serializations or equivalent as input to json_in()
>
> If we want the getter functions to handle the "loose JSON" to Object
> conversion
> side assuming our stored JSON can contain non-unique keys then these are
> bound to be slower, as they have to do these checks. Thay can't just
> grab the first
> matching one and return or recurse on that.

No, there will be no slowdown. The parser doesn't short circuit.

Read the code.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2013-03-09 00:40:26 Re: Enabling Checksums
Previous Message Hannu Krosing 2013-03-08 23:37:26 Re: Duplicate JSON Object Keys