Commit 3f1802e1 authored by Alexander Korotkov's avatar Alexander Korotkov

Documentation corrections for opclass parameters

Discussion: https://postgr.es/m/20200331024419.GB14618%40telsasoft.com
Author: Justin Pryzby
parent 8d84dd00
...@@ -468,13 +468,13 @@ CREATE INDEX hidx ON testhstore USING GIN (h); ...@@ -468,13 +468,13 @@ CREATE INDEX hidx ON testhstore USING GIN (h);
</programlisting> </programlisting>
<para> <para>
<literal>gist_hstore_ops</literal> GiST opclass approximates set of <literal>gist_hstore_ops</literal> GiST opclass approximates a set of
key/value pairs as a bitmap signature. Optional integer parameter key/value pairs as a bitmap signature. Its optional integer parameter
<literal>siglen</literal> of <literal>gist_hstore_ops</literal> determines <literal>siglen</literal> determines the
signature length in bytes. Default signature length is 16 bytes. signature length in bytes. The default length is 16 bytes.
Valid values of signature length are between 1 and 2024 bytes. Longer Valid values of signature length are between 1 and 2024 bytes. Longer
signatures leads to more precise search (scan less fraction of index, scan signatures lead to a more precise search (scanning a smaller fraction of the index and
less heap pages), but larger index. fewer heap pages), at the cost of a larger index.
</para> </para>
<para> <para>
......
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</para> </para>
<para> <para>
Two parametrized GiST index operator classes are provided: Two parameterized GiST index operator classes are provided:
<literal>gist__int_ops</literal> (used by default) is suitable for <literal>gist__int_ops</literal> (used by default) is suitable for
small- to medium-size data sets, while small- to medium-size data sets, while
<literal>gist__intbig_ops</literal> uses a larger signature and is more <literal>gist__intbig_ops</literal> uses a larger signature and is more
...@@ -276,22 +276,23 @@ ...@@ -276,22 +276,23 @@
</para> </para>
<para> <para>
<literal>gist__int_ops</literal> approximates integer set as an array of <literal>gist__int_ops</literal> approximates an integer set as an array of
integer ranges. Optional integer parameter <literal>numranges</literal> of integer ranges. Its optional integer parameter <literal>numranges</literal>
<literal>gist__int_ops</literal> determines maximum number of ranges in determines the maximum number of ranges in
one index key. Default value of <literal>numranges</literal> is 100. one index key. The default value of <literal>numranges</literal> is 100.
Valid values are between 1 and 253. Using larger arrays as GiST index Valid values are between 1 and 253. Using larger arrays as GiST index
keys leads to more precise search (scan less fraction of index, scan less keys leads to a more precise search (scaning a smaller fraction of the index and
heap pages), but larger index. fewer heap pages), at the cost of a larger index.
</para> </para>
<para> <para>
<literal>gist__intbig_ops</literal> approximates integer set as a bitmap <literal>gist__intbig_ops</literal> approximates an integer set as a bitmap
signature. Optional integer parameter <literal>siglen</literal> of signature. Its optional integer parameter <literal>siglen</literal>
<literal>gist__intbig_ops</literal> determines signature length in bytes. determines the signature length in bytes.
Default signature length is 16 bytes. Valid values of signature length The default signature length is 16 bytes. Valid values of signature length
are between 1 and 2024 bytes. Longer signatures leads to more precise are between 1 and 2024 bytes. Longer signatures lead to a more precise
search (scan less fraction of index, scan less heap pages), but larger index. search (scanning a smaller fraction of the index and fewer heap pages), at
the cost of a larger index.
</para> </para>
<para> <para>
......
...@@ -516,16 +516,16 @@ Europe &amp; Russia*@ &amp; !Transportation ...@@ -516,16 +516,16 @@ Europe &amp; Russia*@ &amp; !Transportation
<literal>@</literal>, <literal>~</literal>, <literal>?</literal> <literal>@</literal>, <literal>~</literal>, <literal>?</literal>
</para> </para>
<para> <para>
<literal>gist_ltree_ops</literal> GiST opclass approximates set of <literal>gist_ltree_ops</literal> GiST opclass approximates a set of
path labels as a bitmap signature. Optional integer parameter path labels as a bitmap signature. Its optional integer parameter
<literal>siglen</literal> of <literal>gist_ltree_ops</literal> determines <literal>siglen</literal> determines the
signature length in bytes. Default signature length is 8 bytes. signature length in bytes. The default signature length is 8 bytes.
Valid values of signature length are between 1 and 2024 bytes. Longer Valid values of signature length are between 1 and 2024 bytes. Longer
signatures leads to more precise search (scan less fraction of index, scan signatures lead to a more precise search (scanning a smaller fraction of the index and
less heap pages), but larger index. fewer heap pages), at the cost of a larger index.
</para> </para>
<para> <para>
Example of creating such an index with a default signature length of 8 bytes: Example of creating such an index with the default signature length of 8 bytes:
</para> </para>
<programlisting> <programlisting>
CREATE INDEX path_gist_idx ON test USING GIST (path); CREATE INDEX path_gist_idx ON test USING GIST (path);
...@@ -545,13 +545,13 @@ CREATE INDEX path_gist_idx ON test USING GIST (path gist_ltree_ops(siglen=100)); ...@@ -545,13 +545,13 @@ CREATE INDEX path_gist_idx ON test USING GIST (path gist_ltree_ops(siglen=100));
<literal>@</literal>, <literal>~</literal>, <literal>?</literal> <literal>@</literal>, <literal>~</literal>, <literal>?</literal>
</para> </para>
<para> <para>
<literal>gist__ltree_ops</literal> GiST opclass works similar to <literal>gist__ltree_ops</literal> GiST opclass works similarly to
<literal>gist_ltree_ops</literal> and also takes signature length as <literal>gist_ltree_ops</literal> and also takes signature length as
a parameter. Default value of <literal>siglen</literal> in a parameter. The default value of <literal>siglen</literal> in
<literal>gist__ltree_ops</literal> is 28 bytes. <literal>gist__ltree_ops</literal> is 28 bytes.
</para> </para>
<para> <para>
Example of creating such an index with a default signature length of 28 bytes: Example of creating such an index with the default signature length of 28 bytes:
</para> </para>
<programlisting> <programlisting>
CREATE INDEX path_gist_idx ON test USING GIST (array_path); CREATE INDEX path_gist_idx ON test USING GIST (array_path);
......
...@@ -391,13 +391,13 @@ CREATE INDEX trgm_idx ON test_trgm USING GIN (t gin_trgm_ops); ...@@ -391,13 +391,13 @@ CREATE INDEX trgm_idx ON test_trgm USING GIN (t gin_trgm_ops);
</para> </para>
<para> <para>
<literal>gist_trgm_ops</literal> GiST opclass approximates set of <literal>gist_trgm_ops</literal> GiST opclass approximates a set of
trigrams as a bitmap signature. Optional integer parameter trigrams as a bitmap signature. Its optional integer parameter
<literal>siglen</literal> of <literal>gist_trgm_ops</literal> determines <literal>siglen</literal> determines the
signature length in bytes. Default signature length is 12 bytes. signature length in bytes. The default length is 12 bytes.
Valid values of signature length are between 1 and 2024 bytes. Longer Valid values of signature length are between 1 and 2024 bytes. Longer
signatures leads to more precise search (scan less fraction of index, scan signatures lead to a more precise search (scanning a smaller fraction of the index and
less heap pages), but larger index. fewer heap pages), at the cost of a larger index.
</para> </para>
<para> <para>
......
...@@ -3670,17 +3670,17 @@ SELECT plainto_tsquery('supernovae stars'); ...@@ -3670,17 +3670,17 @@ SELECT plainto_tsquery('supernovae stars');
to check the actual table row to eliminate such false matches. to check the actual table row to eliminate such false matches.
(<productname>PostgreSQL</productname> does this automatically when needed.) (<productname>PostgreSQL</productname> does this automatically when needed.)
GiST indexes are lossy because each document is represented in the GiST indexes are lossy because each document is represented in the
index by a fixed-length signature. Signature length in bytes is determined index by a fixed-length signature. The signature length in bytes is determined
by the value of the optional integer parameter <literal>siglen</literal>. by the value of the optional integer parameter <literal>siglen</literal>.
Default signature length (when <literal>siglen</literal> is not specied) is The default signature length (when <literal>siglen</literal> is not specified) is
124 bytes, maximal length is 2024 bytes. The signature is generated by hashing 124 bytes, the maximum signature length is 2024 bytes. The signature is generated by hashing
each word into a single bit in an n-bit string, with all these bits OR-ed each word into a single bit in an n-bit string, with all these bits OR-ed
together to produce an n-bit document signature. When two words hash to together to produce an n-bit document signature. When two words hash to
the same bit position there will be a false match. If all words in the same bit position there will be a false match. If all words in
the query have matches (real or false) then the table row must be the query have matches (real or false) then the table row must be
retrieved to see if the match is correct. Longer signatures leads to more retrieved to see if the match is correct. Longer signatures lead to a more
precise search (scan less fraction of index, scan less heap pages), but precise search (scanning a smaller fraction of the index and fewer heap
larger index. pages), at the cost of a larger index.
</para> </para>
<para> <para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment