Skip site navigation (1) Skip section navigation (2)

pgsql: Restructure SPGiST opclass interface API to supportwhole-index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Restructure SPGiST opclass interface API to supportwhole-index
Date: 2012-03-10 23:37:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Restructure SPGiST opclass interface API to support whole-index scans.

The original API definition was incapable of supporting whole-index scans
because there was no way to invoke leaf-value reconstruction without
checking any qual conditions.  Also, it was inefficient for
multiple-qual-condition scans because value reconstruction got done over
again for each qual condition, and because other internal work in the
consistent functions likewise had to be done for each qual.  To fix these
issues, pass the whole scankey array to the opclass consistent functions,
instead of only letting them see one item at a time.  (Essentially, the
loop over scankey entries is now inside the consistent functions not
outside them.  This makes the consistent functions a bit more complicated,
but not unreasonably so.)

In itself this commit does nothing except save a few cycles in
multiple-qual-condition index scans, since we can't support whole-index
scans on SPGiST indexes until nulls are included in the index.  However,
I consider this a must-fix for 9.2 because once we release it will get
very much harder to change the opclass API definition.



Modified Files
doc/src/sgml/spgist.sgml                    |   38 +++-
src/backend/access/spgist/spgkdtreeproc.c   |  188 ++++++---------
src/backend/access/spgist/spgquadtreeproc.c |  240 +++++++++----------
src/backend/access/spgist/spgscan.c         |  345 +++++++++++++--------------
src/backend/access/spgist/spgtextproc.c     |  218 +++++++++--------
src/include/access/spgist.h                 |    8 +-
src/include/access/spgist_private.h         |    6 +-
7 files changed, 517 insertions(+), 526 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-03-11 00:05:59
Subject: pgsql: psql: Fix invalid memory access
Previous:From: Peter EisentrautDate: 2012-03-10 18:20:29
Subject: pgsql: Add support for renaming constraints

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group