Allow GiST distance function to return merely a lower-bound.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 15 May 2015 11:26:51 +0000 (14:26 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 15 May 2015 11:26:51 +0000 (14:26 +0300)
commit35fcb1b3d038a501f3f4c87c05630095abaaadab
treed67f36684fb18b8523e78f13c0a358b376f50d4b
parentecd222e770d352121590363ffdf981147a43e976
Allow GiST distance function to return merely a lower-bound.

The distance function can now set *recheck = false, like index quals. The
executor will then re-check the ORDER BY expressions, and use a queue to
reorder the results on the fly.

This makes it possible to do kNN-searches on polygons and circles, which
don't store the exact value in the index, but just a bounding box.

Alexander Korotkov and me
19 files changed:
doc/src/sgml/gist.sgml
src/backend/access/gist/gistget.c
src/backend/access/gist/gistproc.c
src/backend/access/gist/gistscan.c
src/backend/executor/nodeIndexscan.c
src/backend/optimizer/plan/createplan.c
src/backend/utils/adt/geo_ops.c
src/include/access/genam.h
src/include/access/relscan.h
src/include/catalog/catversion.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_amproc.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_proc.h
src/include/nodes/execnodes.h
src/include/nodes/plannodes.h
src/include/utils/geo_decls.h
src/test/regress/expected/create_index.out
src/test/regress/sql/create_index.sql