pgsql: Restructure SPGiST opclass interface API to support whole-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 support whole-index
Date: 2012-03-10 23:37:07
Message-ID: E1S6VqV-0002eI-IY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/03e56f798e365763486b03a2630fbc3190ccd29a

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2012-03-11 00:05:59 pgsql: ecpg: Fix rare memory leaks
Previous Message Peter Eisentraut 2012-03-10 18:20:29 pgsql: Add support for renaming constraints