Re: Patch: Improve Boolean Predicate JSON Path Docs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch: Improve Boolean Predicate JSON Path Docs
Дата
Msg-id 3004346.1705769112@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch: Improve Boolean Predicate JSON Path Docs  ("David E. Wheeler" <david@justatheory.com>)
Ответы Re: Patch: Improve Boolean Predicate JSON Path Docs
Re: Patch: Improve Boolean Predicate JSON Path Docs
Список pgsql-hackers
"David E. Wheeler" <david@justatheory.com> writes:
> While you’re in there, Tom, would it make sense to fold in something like [this patch][1] I posted last month to
clarifywhich JSONPath comparison operators can take advantage of a index? 

> --- a/doc/src/sgml/json.sgml
> +++ b/doc/src/sgml/json.sgml
> @@ -513,7 +513,7 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
> </programlisting>
>     For these operators, a GIN index extracts clauses of the form
>     <literal><replaceable>accessors_chain</replaceable>
> -    = <replaceable>constant</replaceable></literal> out of
> +    == <replaceable>constant</replaceable></literal> out of
>     the <type>jsonpath</type> pattern, and does the index search based on
>     the keys and values mentioned in these clauses.  The accessors chain
>     may include <literal>.<replaceable>key</replaceable></literal>,

Right, clearly a typo.

> @@ -522,6 +522,9 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
>     The <literal>jsonb_ops</literal> operator class also
>     supports <literal>.*</literal> and <literal>.**</literal> accessors,
>     but the <literal>jsonb_path_ops</literal> operator class does not.
> +    Only the <literal>==</literal> and <literal>!=</literal> <link
> +    linkend="functions-sqljson-path-operators">SQL/JSON Path Operators</link>
> +    can use the index.
>   </para>

You sure about that?  It would surprise me if we could effectively use
a not-equal condition with an index.  If it is only == that works,
then the preceding statement seems sufficient.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PG12 change to DO UPDATE SET column references
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Patch: Improve Boolean Predicate JSON Path Docs