diff options
author | Teodor Sigaev | 2016-03-30 15:29:28 +0000 |
---|---|---|
committer | Teodor Sigaev | 2016-03-30 15:29:28 +0000 |
commit | ccd6eb49a4ae924290ab7eba5540218f5beb48b8 (patch) | |
tree | a5c1a9d35b8dd70d7e8bb06a6370de599d64b15c /doc/src/sgml/spgist.sgml | |
parent | 3063e7a84026ced2aadd2262f75eebbe6240f85b (diff) |
Introduce traversalValue for SP-GiST scan
During scan sometimes it would be very helpful to know some information about
parent node or all ancestor nodes. Right now reconstructedValue could be used
but it's not a right usage of it (range opclass uses that).
traversalValue is arbitrary piece of memory in separate MemoryContext while
reconstructedVale should have the same type as indexed column.
Subsequent patches for range opclass and quad4d tree will use it.
Author: Alexander Lebedev, Teodor Sigaev
Diffstat (limited to 'doc/src/sgml/spgist.sgml')
-rw-r--r-- | doc/src/sgml/spgist.sgml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml index 56827e520dd..0d44d064aaa 100644 --- a/doc/src/sgml/spgist.sgml +++ b/doc/src/sgml/spgist.sgml @@ -542,6 +542,8 @@ typedef struct spgInnerConsistentIn int nkeys; /* length of array */ Datum reconstructedValue; /* value reconstructed at parent */ + void *traversalValue; /* opclass-specific traverse value */ + MemoryContext traversalMemoryContext; int level; /* current level (counting from zero) */ bool returnData; /* original data must be returned? */ @@ -559,6 +561,8 @@ typedef struct spgInnerConsistentOut 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 */ + } spgInnerConsistentOut; </programlisting> @@ -593,6 +597,9 @@ typedef struct spgInnerConsistentOut inner tuple, and <structfield>nodeLabels</> is an array of their label values, or NULL if the nodes do not have labels. + <structfield>traversalValue</> is a pointer to data that + <function>inner_consistent</> gets when called on child nodes from an + outer call of <function>inner_consistent</> on parent nodes. </para> <para> @@ -612,6 +619,13 @@ typedef struct spgInnerConsistentOut responsible for palloc'ing the <structfield>nodeNumbers</>, <structfield>levelAdds</> and <structfield>reconstructedValues</> arrays. + Sometimes accumulating some information is needed, while + descending from parent to child node was happened. In this case + <structfield>traversalValues</> array keeps pointers to + specific data you need to accumulate for every child node. + Memory for <structfield>traversalValues</> should be allocated in + the default context, but each element of it should be allocated in + <structfield>traversalMemoryContext</>. </para> </listitem> </varlistentry> @@ -638,6 +652,7 @@ typedef struct spgLeafConsistentIn ScanKey scankeys; /* array of operators and comparison values */ int nkeys; /* length of array */ + void *traversalValue; /* opclass-specific traverse value */ Datum reconstructedValue; /* value reconstructed at parent */ int level; /* current level (counting from zero) */ bool returnData; /* original data must be returned? */ |