Re: Schizophrenic coding in gin_extract_jsonb(_hash)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Schizophrenic coding in gin_extract_jsonb(_hash)
Дата
Msg-id 28555.1399476449@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Schizophrenic coding in gin_extract_jsonb(_hash)  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Schizophrenic coding in gin_extract_jsonb(_hash)
Список pgsql-hackers
Peter Geoghegan <pg@heroku.com> writes:
> On Tue, May 6, 2014 at 8:08 PM, Tom Lane <tgl@sss.pgh.pa.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.

And?

I think you're just proving the point that this code is woefully
underdocumented.  If there were, somewhere, some comment explaining
what the heck JB_ROOT_COUNT actually counts, maybe I wouldn't be asking
this question.  jsonb.h is certainly not divulging any such information.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PGDLLEXPORTing all GUCs?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: PGDLLEXPORTing all GUCs?