pgsql: Add support for index-only scans in GiST.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add support for index-only scans in GiST.
Date: 2015-03-26 17:12:56
Message-ID: E1YbBKy-0000at-AF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add support for index-only scans in GiST.

This adds a new GiST opclass method, 'fetch', which is used to reconstruct
the original Datum from the value stored in the index. Also, the 'canreturn'
index AM interface function gains a new 'attno' argument. That makes it
possible to use index-only scans on a multi-column index where some of the
opclasses support index-only scans but some do not.

This patch adds support in the box and point opclasses. Other opclasses
can added later as follow-on patches (btree_gist would be particularly
interesting).

Anastasia Lubennikova, with additional fixes and modifications by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d04c8ed9044eccebce043143a930617e3998c005

Modified Files
--------------
doc/src/sgml/catalogs.sgml | 4 +-
doc/src/sgml/gist.sgml | 73 +++++++++++++-
doc/src/sgml/indexam.sgml | 15 +--
src/backend/access/gist/gist.c | 8 ++
src/backend/access/gist/gistget.c | 66 ++++++++++++-
src/backend/access/gist/gistproc.c | 37 +++++++
src/backend/access/gist/gistscan.c | 18 ++++
src/backend/access/gist/gistutil.c | 64 +++++++++++-
src/backend/access/index/indexam.c | 12 ++-
src/backend/access/spgist/spgscan.c | 1 +
src/backend/optimizer/path/indxpath.c | 22 +++--
src/backend/optimizer/util/plancat.c | 3 +-
src/include/access/genam.h | 2 +-
src/include/access/gist.h | 3 +-
src/include/access/gist_private.h | 9 +-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_am.h | 2 +-
src/include/catalog/pg_amproc.h | 2 +
src/include/catalog/pg_proc.h | 10 +-
src/include/nodes/relation.h | 3 +-
src/include/utils/geo_decls.h | 3 +
src/test/regress/expected/create_index.out | 70 ++++++-------
src/test/regress/expected/gist.out | 146 ++++++++++++++++++++++++++++
src/test/regress/sql/gist.sql | 73 ++++++++++++++
24 files changed, 575 insertions(+), 73 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-03-26 18:03:40 pgsql: Tweak __attribute__-wrapping macros for better pgindent results.
Previous Message Tom Lane 2015-03-26 16:00:35 pgsql: Suppress some unused-variable complaints in new LOCK_DEBUG code.