Re: jsonb contains behaviour weirdness

Поиск
Список
Период
Сортировка
Искать
От
Peter Geoghegan
Тема
Re: jsonb contains behaviour weirdness
Дата
Msg-id
CAM3SWZQ18f9Dk0WeOmWCygrsqXJRP_BCYx7FR9T54Xa2ma_e_Q@mail.gmail.com
Ответ на
Список
Дерево обсуждения
jsonb contains behaviour weirdness Alexander Korotkov <aekorotkov@gmail.com>
Re: jsonb contains behaviour weirdness Peter Geoghegan <pg@heroku.com>
Re: jsonb contains behaviour weirdness Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonb contains behaviour weirdness Peter Geoghegan <pg@heroku.com>
Re: jsonb contains behaviour weirdness Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonb contains behaviour weirdness Peter Geoghegan <pg@heroku.com>
Re: jsonb contains behaviour weirdness Peter Geoghegan <pg@heroku.com>
Re: jsonb contains behaviour weirdness Tom Lane <tgl@sss.pgh.pa.us>
This was never committed...

On Sat, Sep 13, 2014 at 4:31 PM, Peter Geoghegan  wrote:
> On Fri, Sep 12, 2014 at 6:40 AM, Alexander Korotkov
>  wrote:
>> It's likely that "JB_ROOT_COUNT(val) < JB_ROOT_COUNT(tmpl)" should be
>> checked only for objects, not arrays. Also, should JsonbDeepContains does
>> same fast check when it deals with nested objects?
>
> Attached patch implements something similar to what you describe here,
> fixing your example.
>
> I haven't added the optimization to JsonbDeepContains(). I think that
> if anything, we should remove the optimization entirely, which is what
> I've done -- an rhs "is it contained within?" value is hardly ever
> going to be an object that has more pairs than the object we're
> checking it is contained within. It's almost certainly going to have
> far fewer pairs. Apart from only applying to objects, that
> optimization just isn't an effective way of eliminating jsonb values
> from consideration quickly. I'd rather not bother at all, rather than
> having a complicated comment about why the optimization applies to
> objects and not arrays.

-- 
Peter Geoghegan


В списке pgsql-hackers по дате отправления
От: Simon Riggs
Дата:
Сообщение: Re: Column Redaction
От: Simon Riggs
Дата:
Сообщение: Re: Column Redaction
FAQ