@@ -145,6 +145,7 @@ typedef struct spgConfigOut
145
145
{
146
146
Oid prefixType; /* Data type of inner-tuple prefixes */
147
147
Oid labelType; /* Data type of inner-tuple node labels */
148
+ bool canReturnData; /* Opclass can reconstruct original data */
148
149
bool longValuesOK; /* Opclass can cope with values > 1 page */
149
150
} spgConfigOut;
150
151
</programlisting>
@@ -159,6 +160,8 @@ typedef struct spgConfigOut
159
160
<structfield>prefixType</> can be set to <literal>VOIDOID</>.
160
161
Likewise, for operator classes that do not use node labels,
161
162
<structfield>labelType</> can be set to <literal>VOIDOID</>.
163
+ <structfield>canReturnData</> should be set true if the operator class
164
+ is capable of reconstructing the originally-supplied index value.
162
165
<structfield>longValuesOK</> should be set true only when the
163
166
<structfield>attType</> is of variable length and the operator
164
167
class is capable of segmenting long values by repeated suffixing
@@ -441,6 +444,7 @@ typedef struct spgInnerConsistentIn
441
444
442
445
Datum reconstructedValue; /* value reconstructed at parent */
443
446
int level; /* current level (counting from zero) */
447
+ bool returnData; /* original data must be returned? */
444
448
445
449
/* Data from current inner tuple */
446
450
bool allTheSame; /* tuple is marked all-the-same? */
@@ -467,6 +471,9 @@ typedef struct spgInnerConsistentOut
467
471
parent level.
468
472
<structfield>level</> is the current inner tuple's level, starting at
469
473
zero for the root level.
474
+ <structfield>returnData</> is <literal>true</> if reconstructed data is
475
+ required for this query; this will only be so if the
476
+ <function>config</> function asserted <structfield>canReturnData</>.
470
477
<structfield>allTheSame</> is true if the current inner tuple is
471
478
marked <quote>all-the-same</>; in this case all the nodes have the
472
479
same label (if any) and so either all or none of them match the query
@@ -525,12 +532,14 @@ typedef struct spgLeafConsistentIn
525
532
526
533
Datum reconstructedValue; /* value reconstructed at parent */
527
534
int level; /* current level (counting from zero) */
535
+ bool returnData; /* original data must be returned? */
528
536
529
537
Datum leafDatum; /* datum in leaf tuple */
530
538
} spgLeafConsistentIn;
531
539
532
540
typedef struct spgLeafConsistentOut
533
541
{
542
+ Datum leafValue; /* reconstructed original data, if any */
534
543
bool recheck; /* set true if operator must be rechecked */
535
544
} spgLeafConsistentOut;
536
545
</programlisting>
@@ -543,13 +552,19 @@ typedef struct spgLeafConsistentOut
543
552
parent level.
544
553
<structfield>level</> is the current leaf tuple's level, starting at
545
554
zero for the root level.
555
+ <structfield>returnData</> is <literal>true</> if reconstructed data is
556
+ required for this query; this will only be so if the
557
+ <function>config</> function asserted <structfield>canReturnData</>.
546
558
<structfield>leafDatum</> is the key value stored in the current
547
559
leaf tuple.
548
560
</para>
549
561
550
562
<para>
551
563
The function must return <literal>true</> if the leaf tuple matches the
552
564
query, or <literal>false</> if not. In the <literal>true</> case,
565
+ if <structfield>returnData</> is <literal>true</> then
566
+ <structfield>leafValue</> must be set to the value originally supplied
567
+ to be indexed for this leaf tuple. Also,
553
568
<structfield>recheck</> may be set to <literal>true</> if the match
554
569
is uncertain and so the operator must be re-applied to the actual heap
555
570
tuple to verify the match.
0 commit comments