Re: Schizophrenic coding in gin_extract_jsonb(_hash)

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Schizophrenic coding in gin_extract_jsonb(_hash)
Date: 2014-05-07 03:56:54
Message-ID: CAM3SWZQSn33Rin5ziNYLNhnTz+4nhsm9hq_970rSavJQLkpJ5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 6, 2014 at 8:08 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The early-exit code path supposes that JB_ROOT_COUNT is absolutely
> reliable as an indicator that there's nothing in the jsonb value.
> On the other hand, the realloc logic inside the iteration loop implies
> that JB_ROOT_COUNT is just an untrustworthy estimate. Which theory is
> correct? And why is there not a comment to be seen anywhere? If the code
> is correct then this logic is certainly worthy of a comment or three.

JsonbIteratorNext() is passed "false" as its skipNested argument. It's
recursive.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-05-07 04:21:05 Re: New pg_lsn type doesn't have hash/btree opclasses
Previous Message Tom Lane 2014-05-07 03:22:09 Re: need xmllint on borka