1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

doc: adjust JSONB GIN index description

Backpatch through 9.4
This commit is contained in:
Bruce Momjian 2014-06-21 15:33:22 -04:00
parent 750c0351ea
commit a2586dece1

View File

@ -460,11 +460,16 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"tags": ["qu
and a <literal>jsonb_path_ops</literal> GIN index is that the former and a <literal>jsonb_path_ops</literal> GIN index is that the former
creates independent index items for each key and value in the data, creates independent index items for each key and value in the data,
while the latter creates index items only for each value in the while the latter creates index items only for each value in the
data.<footnote><para>For this purpose, the term <quote>value</> data.
includes array elements, though JSON terminology sometimes considers <footnote>
array elements distinct from values within objects.</para></footnote> <para>
But in <literal>jsonb_path_ops</literal>, each index item is a hash For this purpose, the term <quote>value</> includes array elements,
of both the value and the key(s) leading to it; for example to index though JSON terminology sometimes considers array elements distinct
from values within objects.
</para>
</footnote>
Basically, each <literal>jsonb_path_ops</literal> index item is
a hash of the value and the key(s) leading to it; for example to index
<literal>{"foo": {"bar": "baz"}}</literal>, a single index item would <literal>{"foo": {"bar": "baz"}}</literal>, a single index item would
be created incorporating all three of <literal>foo</>, <literal>bar</>, be created incorporating all three of <literal>foo</>, <literal>bar</>,
and <literal>baz</> into the hash value. Thus a containment query and <literal>baz</> into the hash value. Thus a containment query