Re: Re: [SQL] querying with index on jsonb slower than standard column. Why?

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: Re: [SQL] querying with index on jsonb slower than standard column. Why?
Дата
Msg-id CAGTBQpZDYYF+UYgFQrKUutGk1pHJ2i0m7DS8sgte0GyZf7A8tg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Re: [SQL] querying with index on jsonb slower than standard column. Why?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Fri, Dec 12, 2014 at 6:44 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The usability issue could be fixed by teaching the planner to fold a
> construct like (jsonb ->> 'foo')::numeric into (jsonb ->># 'foo').
> But I'm not sure how we do that except in a really ugly and ad-hoc
> fashion.

It would be doable if you could have polymorphism on return type, and
teach the planner to interpret (jsonb ->> 'foo')::numeric as the
operator with a numeric return type.

That's a trickier business even, but it could be far more useful and
generically helpful than ->>#.

Tricky part is what to do when the cast is missing.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: [SQL] querying with index on jsonb slower than standard column. Why?
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Re: [SQL] querying with index on jsonb slower than standard column. Why?