| От | Thomas Kellerer |
|---|---|
| Тема | Re: Using vars in jsonbpath operator ? |
| Дата | |
| Msg-id | 39a04bd8-aefd-b02e-594b-ca875a884048@gmx.net обсуждение исходный текст |
| Ответ на | Using vars in jsonbpath operator ? (Markur Sens <markursens@gmail.com>) |
| Список | pgsql-general |
Markur Sens schrieb am 16.06.2023 um 13:54: > I understand that on a where clause a gin index can be used for the following predicate > > a.data @? '$.results.docs[*].accs[*] ? (@.id == “123") > > I have a join query however on the following condition > > jsonb_path_exists(a.data, '$.results.docs[*].accs[*] ? (@.number == $id)', jsonb_build_object(‘id', *b.id*)) but thiscannot use a gin index afaik and results in a seq scan. > > Is there anyway to use the operator syntax above by passing the b.id <http://b.id> variable somwehow so that the gin indexcan be used ? ? > I think you will need to pass the whole jsonpath as a parameter, e.g. a.data @? cast($1 as jsonpath) At least that's the only way I could achieve this
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера