- gist_hstore_ops GiST opclass approximates set of
- key/value pairs as a bitmap signature. Optional integer parameter
- siglen of gist_hstore_ops determines
- signature length in bytes. Default signature length is 16 bytes.
+ gist_hstore_ops GiST opclass approximates a set of
+ key/value pairs as a bitmap signature. Its optional integer parameter
+ siglen determines the
+ signature length in bytes. The default length is 16 bytes.
Valid values of signature length are between 1 and 2024 bytes. Longer
- signatures leads to more precise search (scan less fraction of index, scan
- less heap pages), but larger index.
+ signatures lead to a more precise search (scanning a smaller fraction of the index and
+ fewer heap pages), at the cost of a larger index.
- Two parametrized GiST index operator classes are provided:
+ Two parameterized GiST index operator classes are provided:
gist__int_ops (used by default) is suitable for
small- to medium-size data sets, while
gist__intbig_ops uses a larger signature and is more
- gist__int_ops approximates integer set as an array of
- integer ranges. Optional integer parameter numranges of
- gist__int_ops determines maximum number of ranges in
- one index key. Default value of numranges is 100.
+ gist__int_ops approximates an integer set as an array of
+ integer ranges. Its optional integer parameter numranges
+ determines the maximum number of ranges in
+ one index key. The default value of numranges is 100.
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
- heap pages), but larger index.
+ keys leads to a more precise search (scaning a smaller fraction of the index and
+ fewer heap pages), at the cost of a larger index.
- gist__intbig_ops approximates integer set as a bitmap
- signature. Optional integer parameter siglen of
- gist__intbig_ops determines signature length in bytes.
- Default signature length is 16 bytes. Valid values of signature length
- are between 1 and 2024 bytes. Longer signatures leads to more precise
- search (scan less fraction of index, scan less heap pages), but larger index.
+ gist__intbig_ops approximates an integer set as a bitmap
+ signature. Its optional integer parameter siglen
+ determines the signature length in bytes.
+ The default signature length is 16 bytes. Valid values of signature length
+ are between 1 and 2024 bytes. Longer signatures lead to a more precise
+ search (scanning a smaller fraction of the index and fewer heap pages), at
+ the cost of a larger index.
@, ~, ?
- gist_ltree_ops GiST opclass approximates set of
- path labels as a bitmap signature. Optional integer parameter
- siglen of gist_ltree_ops determines
- signature length in bytes. Default signature length is 8 bytes.
+ gist_ltree_ops GiST opclass approximates a set of
+ path labels as a bitmap signature. Its optional integer parameter
+ siglen determines the
+ signature length in bytes. The default signature length is 8 bytes.
Valid values of signature length are between 1 and 2024 bytes. Longer
- signatures leads to more precise search (scan less fraction of index, scan
- less heap pages), but larger index.
+ signatures lead to a more precise search (scanning a smaller fraction of the index and
+ fewer heap pages), at the cost of a larger index.
- 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:
CREATE INDEX path_gist_idx ON test USING GIST (path);
@, ~, ?
- gist__ltree_ops GiST opclass works similar to
+ gist__ltree_ops GiST opclass works similarly to
gist_ltree_ops and also takes signature length as
- a parameter. Default value of siglen in
+ a parameter. The default value of siglen in
gist__ltree_ops is 28 bytes.
- 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:
CREATE INDEX path_gist_idx ON test USING GIST (array_path);
- gist_trgm_ops GiST opclass approximates set of
- trigrams as a bitmap signature. Optional integer parameter
- siglen of gist_trgm_ops determines
- signature length in bytes. Default signature length is 12 bytes.
+ gist_trgm_ops GiST opclass approximates a set of
+ trigrams as a bitmap signature. Its optional integer parameter
+ siglen determines the
+ signature length in bytes. The default length is 12 bytes.
Valid values of signature length are between 1 and 2024 bytes. Longer
- signatures leads to more precise search (scan less fraction of index, scan
- less heap pages), but larger index.
+ signatures lead to a more precise search (scanning a smaller fraction of the index and
+ fewer heap pages), at the cost of a larger index.
to check the actual table row to eliminate such false matches.
(
PostgreSQL does this automatically when needed.)
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 siglen.
- Default signature length (when siglen is not specied) is
- 124 bytes, maximal length is 2024 bytes. The signature is generated by hashing
+ The default signature length (when siglen is not specified) is
+ 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
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 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
- precise search (scan less fraction of index, scan less heap pages), but
- larger index.
+ retrieved to see if the match is correct. Longer signatures lead to a more
+ precise search (scanning a smaller fraction of the index and fewer heap
+ pages), at the cost of a larger index.