pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Allow GiST distance function to return merely a lower-bound.
Date: Fri, 15 May 2015 11:27:13 +0000
Message-ID: <E1YtDlp-0002at-3o@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/35fcb1b3d038a501f3f4c87c05630095abaaadab

Modified Files
--------------
doc/src/sgml/gist.sgml                     |   35 ++-
src/backend/access/gist/gistget.c          |   30 ++-
src/backend/access/gist/gistproc.c         |   37 +++
src/backend/access/gist/gistscan.c         |    5 +
src/backend/executor/nodeIndexscan.c       |  379 +++++++++++++++++++++++++++-
src/backend/optimizer/plan/createplan.c    |   73 ++++--
src/backend/utils/adt/geo_ops.c            |   27 ++
src/include/access/genam.h                 |    3 +
src/include/access/relscan.h               |    9 +
src/include/catalog/catversion.h           |    2 +-
src/include/catalog/pg_amop.h              |    2 +
src/include/catalog/pg_amproc.h            |    2 +
src/include/catalog/pg_operator.h          |    8 +-
src/include/catalog/pg_proc.h              |    4 +
src/include/nodes/execnodes.h              |   20 ++
src/include/nodes/plannodes.h              |   10 +-
src/include/utils/geo_decls.h              |    3 +
src/test/regress/expected/create_index.out |   78 ++++++
src/test/regress/sql/create_index.sql      |   12 +
19 files changed, 699 insertions(+), 40 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1YtDlp-0002at-3o@gemulon.postgresql.org>
Permalink:  ../E1YtDlp-0002at-3o@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YtDlp-0002at-3o@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@postgresql.org
  Subject: Re: pgsql: Allow GiST distance function to return merely a lower-bound.
  In-Reply-To: <E1YtDlp-0002at-3o@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox