Re: Schizophrenic coding in gin_extract_jsonb(_hash) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Schizophrenic coding in gin_extract_jsonb(_hash)
Date
Msg-id 30630.1399481962@sss.pgh.pa.us
Whole thread Raw
In response to Re: Schizophrenic coding in gin_extract_jsonb(_hash)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> gin_extract_jsonb recursively extracts all the elements, keys and values 
> of any sub-object too, but JB_ROOT_COUNT only counts the top-level elements.

Got it.  So if the top level is empty, we can exit early, but otherwise we
use its length * 2 as a guess at how big the output will be; which will
be right if it's an object without further substructure, and otherwise
might need enlargement.

> (I hope this is made a bit more clear in the comments I added in the 
> patch I posted this morning)

Didn't read that yet, but will incorporate this info into the jsonb_gin
patch I'm working on.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: PGDLLEXPORTing all GUCs?
Next
From: Tom Lane
Date:
Subject: Re: PGDLLEXPORTing all GUCs?