From 92203624934095163f8b57b5b3d7bbd2645da2c8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 19 Dec 2011 14:58:41 -0500 Subject: Teach SP-GiST to do index-only scans. Operator classes can specify whether or not they support this; this preserves the flexibility to use lossy representations within an index. In passing, move constant data about a given index into the rd_amcache cache area, instead of doing fresh lookups each time we start an index operation. This is mainly to try to make sure that spgcanreturn() has insignificant cost; I still don't have any proof that it matters for actual index accesses. Also, get rid of useless copying of FmgrInfo pointers; we can perfectly well use the relcache's versions in-place. --- src/include/access/spgist.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/access/spgist.h') diff --git a/src/include/access/spgist.h b/src/include/access/spgist.h index df6fec6cf4..d2f0a72c36 100644 --- a/src/include/access/spgist.h +++ b/src/include/access/spgist.h @@ -43,6 +43,7 @@ typedef struct spgConfigOut { Oid prefixType; /* Data type of inner-tuple prefixes */ Oid labelType; /* Data type of inner-tuple node labels */ + bool canReturnData; /* Opclass can reconstruct original data */ bool longValuesOK; /* Opclass can cope with values > 1 page */ } spgConfigOut; @@ -132,6 +133,7 @@ typedef struct spgInnerConsistentIn Datum reconstructedValue; /* value reconstructed at parent */ int level; /* current level (counting from zero) */ + bool returnData; /* original data must be returned? */ /* Data from current inner tuple */ bool allTheSame; /* tuple is marked all-the-same? */ @@ -159,12 +161,14 @@ typedef struct spgLeafConsistentIn Datum reconstructedValue; /* value reconstructed at parent */ int level; /* current level (counting from zero) */ + bool returnData; /* original data must be returned? */ Datum leafDatum; /* datum in leaf tuple */ } spgLeafConsistentIn; typedef struct spgLeafConsistentOut { + Datum leafValue; /* reconstructed original data, if any */ bool recheck; /* set true if operator must be rechecked */ } spgLeafConsistentOut; -- cgit v1.2.1