Add an in-core GiST index opclass for inet/cidr types.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Apr 2014 19:46:14 +0000 (15:46 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Apr 2014 19:46:43 +0000 (15:46 -0400)
commitf23a5630ebc797219b62797f566dec9f65090e03
tree0a3e201a90d27c8be311fc97e6674befbb960f4b
parent02f65617eab3deb715428a3ed62ca4e7f56ceda3
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
21 files changed:
doc/src/sgml/func.sgml
doc/src/sgml/gin.sgml
doc/src/sgml/gist.sgml
doc/src/sgml/indices.sgml
doc/src/sgml/spgist.sgml
src/backend/utils/adt/Makefile
src/backend/utils/adt/network.c
src/backend/utils/adt/network_gist.c [new file with mode: 0644]
src/backend/utils/adt/network_selfuncs.c [new file with mode: 0644]
src/include/catalog/catversion.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_amproc.h
src/include/catalog/pg_opclass.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_opfamily.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/include/utils/inet.h
src/test/regress/expected/inet.out
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/inet.sql