Improve implementation of range-contains-element tests.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 Nov 2011 22:45:02 +0000 (17:45 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 Nov 2011 22:45:37 +0000 (17:45 -0500)
commitcddc819e45010492da00164d225a749661f43aef
tree310bec8fb6eed089949c73f800c786ab3d94f199
parentf1b4aa2a84732255bd8a34fc9c7994a04409b77a
Improve implementation of range-contains-element tests.

Implement these tests directly instead of constructing a singleton range
and then applying range-contains.  This saves a range serialize/deserialize
cycle as well as a couple of redundant bound-comparison steps, and adds
very little code on net.

Remove elem_contained_by_range from the GiST opclass: it doesn't belong
there because there is no way to use it in an index clause (where the
indexed column would have to be on the left).  Its commutator is in the
opclass, and that's what counts.
src/backend/utils/adt/rangetypes.c
src/backend/utils/adt/rangetypes_gist.c
src/include/catalog/catversion.h
src/include/catalog/pg_amop.h
src/test/regress/expected/opr_sanity.out