diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-04-08 15:46:14 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-04-08 15:46:43 -0400 |
commit | f23a5630ebc797219b62797f566dec9f65090e03 (patch) | |
tree | 0a3e201a90d27c8be311fc97e6674befbb960f4b /doc/src/sgml/spgist.sgml | |
parent | 02f65617eab3deb715428a3ed62ca4e7f56ceda3 (diff) | |
download | postgresql-f23a5630ebc797219b62797f566dec9f65090e03.tar.gz postgresql-f23a5630ebc797219b62797f566dec9f65090e03.zip |
Add an in-core GiST index opclass for inet/cidr types.
This operator class can accelerate subnet/supernet tests as well as
btree-equivalent ordered comparisons. It also handles a new network
operator inet && inet (overlaps, a/k/a "is supernet or subnet of"),
which is expected to be useful in exclusion constraints.
Ideally this opclass would be the default for GiST with inet/cidr data,
but we can't mark it that way until we figure out how to do a more or
less graceful transition from the current situation, in which the
really-completely-bogus inet/cidr opclasses in contrib/btree_gist are
marked as default. Having the opclass in core and not default is better
than not having it at all, though.
While at it, add new documentation sections to allow us to officially
document GiST/GIN/SP-GiST opclasses, something there was never a clear
place to do before. I filled these in with some simple tables listing
the existing opclasses and the operators they support, but there's
certainly scope to put more information there.
Emre Hasegeli, reviewed by Andreas Karlsson, further hacking by me
Diffstat (limited to 'doc/src/sgml/spgist.sgml')
-rw-r--r-- | doc/src/sgml/spgist.sgml | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml index a043ffb06c4..56827e520dd 100644 --- a/doc/src/sgml/spgist.sgml +++ b/doc/src/sgml/spgist.sgml @@ -53,6 +53,93 @@ </sect1> +<sect1 id="spgist-builtin-opclasses"> + <title>Built-in Operator Classes</title> + + <para> + The core <productname>PostgreSQL</> distribution + includes the <acronym>SP-GiST</acronym> operator classes shown in + <xref linkend="spgist-builtin-opclasses-table">. + </para> + + <table id="spgist-builtin-opclasses-table"> + <title>Built-in <acronym>SP-GiST</acronym> Operator Classes</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Indexed Data Type</entry> + <entry>Indexable Operators</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>kd_point_ops</></entry> + <entry><type>point</></entry> + <entry> + <literal><<</> + <literal><@</> + <literal><^</> + <literal>>></> + <literal>>^</> + <literal>~=</> + </entry> + </row> + <row> + <entry><literal>quad_point_ops</></entry> + <entry><type>point</></entry> + <entry> + <literal><<</> + <literal><@</> + <literal><^</> + <literal>>></> + <literal>>^</> + <literal>~=</> + </entry> + </row> + <row> + <entry><literal>range_ops</></entry> + <entry>any range type</entry> + <entry> + <literal>&&</> + <literal>&<</> + <literal>&></> + <literal>-|-</> + <literal><<</> + <literal><@</> + <literal>=</> + <literal>>></> + <literal>@></> + </entry> + </row> + <row> + <entry><literal>text_ops</></entry> + <entry><type>text</></entry> + <entry> + <literal><</> + <literal><=</> + <literal>=</> + <literal>></> + <literal>>=</> + <literal>~<=~</> + <literal>~<~</> + <literal>~>=~</> + <literal>~>~</> + </entry> + </row> + </tbody> + </tgroup> + </table> + + <para> + Of the two operator classes for type <type>point</>, + <literal>quad_point_ops</> is the default. <literal>kd_point_ops</> + supports the same operators but uses a different index data structure which + may offer better performance in some applications. + </para> + +</sect1> + <sect1 id="spgist-extensibility"> <title>Extensibility</title> |