current inner tuple */
bool allTheSame; /* tuple is marked all-the-same? */
bool hasPrefix; /* tuple has a prefix? */
Datum prefixDatum; /* if so, the prefix value */
int nNodes; /* number of nodes in the inner tuple */
Datum *nodeLabels; /* node label values (NULL if none) */
} spgInnerConsistentIn;
typedef struct spgInnerConsistentOut
{
int nNodes; /* number of child nodes to be visited */
int *nodeNumbers; /* their indexes in the node array */
int *levelAdds; /* increment level by this much for each */
Datum *reconstructedValues; /* associated reconstructed values */
void **traversalValues; /* opclass-specific traverse values */
double **distances; /* associated distances */
} spgInnerConsistentOut;
</programlisting>
The array <structfield>scankeys</structfield>, of length <structfield>nkeys</structfield>,
describes the index search condition(s). These conditions are
combined with AND — only index entries that satisfy all of
them are interesting. (Note that <structfield>nkeys</structfield> = 0 implies
that all index entries satisfy the query.) Usually the consistent
function only cares about the <structfield>sk_strategy</structfield> and
<structfield>sk_argument</structfield> fields of each array entry, which
respectively give the indexable operator and comparison value.
In particular it is not necessary to check <structfield>sk_flags</structfield> to
see if the comparison value is NULL, because the SP-GiST core code
will filter out such conditions.
The array <structfield>orderbys</structfield>, of length <structfield>norderbys</structfield>,
describes ordering operators (if any) in the same manner.
<structfield>reconstructedValue</structfield> is the value reconstructed for the
parent tuple; it is <literal>(Datum) 0</literal> at the root level or if the
<function>inner_consistent</function> function did not provide a value at the
parent level.
<structfield>traversalValue</structfield> is a pointer to any traverse data
passed down from the previous call of <function>inner_consistent</function>
on the parent index tuple, or NULL at the root level.
<structfield>traversalMemoryContext</structfield> is the memory context in which
to store output traverse values (see below).
<structfield>level</structfield> is the current inner tuple's level, starting at
zero for the root level.
<structfield>returnData</structfield> is <literal>true</literal> if reconstructed data is
required for this query; this will only be so if the
<function>config</function> function asserted <structfield>canReturnData</structfield>.
<structfield>allTheSame</structfield> is true if the current inner tuple is
marked <quote>all-the-same</quote>; in this case all the nodes have the
same label (if any) and so either all or none of them match the query
(see <xref linkend="spgist-all-the-same"/>).
<structfield>hasPrefix</structfield> is true if the current inner tuple contains
a prefix; if so,
<structfield>prefixDatum</structfield> is its value.
<structfield>nNodes</structfield> is the number of child nodes contained in the
inner tuple, and
<structfield>nodeLabels</structfield> is an array of their label values, or
NULL if the nodes do not have labels.
</para>
<para>
<structfield>nNodes</structfield> must be set to the number of child nodes that
need to be visited by the search, and
<structfield>nodeNumbers</structfield> must be set to an array of their indexes.
If the operator class keeps track of levels, set
<structfield>levelAdds</structfield> to an array of the level increments