summaryrefslogtreecommitdiff
path: root/src/backend/access/spgist/README
diff options
context:
space:
mode:
authorTom Lane2021-04-05 22:41:09 +0000
committerTom Lane2021-04-05 22:41:21 +0000
commit09c1c6ab4bc5764dd69c53ccfd43b2060b1fd090 (patch)
tree0b5eacefe5007d52388f475499b018cccd228c0e /src/backend/access/spgist/README
parent49f49defe7c0a330cca084de5da14ccdfdafc6a3 (diff)
Support INCLUDE'd columns in SP-GiST.
Not much to say here: does what it says on the tin. We steal a previously-always-zero bit from the nextOffset field of leaf index tuples in order to track whether there is a nulls bitmap. Otherwise it works about like included columns in other index types. Pavel Borisov, reviewed by Andrey Borodin and Anastasia Lubennikova, and rather heavily editorialized on by me Discussion: https://postgr.es/m/CALT9ZEFi-vMp4faht9f9Junb1nO3NOSjhpxTmbm1UGLMsLqiEQ@mail.gmail.com
Diffstat (limited to 'src/backend/access/spgist/README')
-rw-r--r--src/backend/access/spgist/README18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/access/spgist/README b/src/backend/access/spgist/README
index b55b0738320..7117e02c770 100644
--- a/src/backend/access/spgist/README
+++ b/src/backend/access/spgist/README
@@ -56,7 +56,7 @@ list and there is no free space on page, then SP-GiST creates a new inner
tuple and distributes leaf tuples into a set of lists on, perhaps, several
pages.
-Inner tuple consists of:
+An inner tuple consists of:
optional prefix value - all successors must be consistent with it.
Example:
@@ -67,14 +67,26 @@ Inner tuple consists of:
list of nodes, where node is a (label, pointer) pair.
Example of a label: a single character for radix tree
-Leaf tuple consists of:
+A leaf tuple consists of:
a leaf value
Example:
radix tree - the rest of string (postfix)
quad and k-d tree - the point itself
- ItemPointer to the heap
+ ItemPointer to the corresponding heap tuple
+ nextOffset number of next leaf tuple in a chain on a leaf page
+
+ optional nulls bitmask
+ optional INCLUDE-column values
+
+For compatibility with pre-v14 indexes, a leaf tuple has a nulls bitmask
+only if there are null values (among the leaf value and the INCLUDE values)
+*and* there is at least one INCLUDE column. The null-ness of the leaf
+value can be inferred from whether the tuple is on a "nulls page" (see below)
+so it is not necessary to represent it explicitly. But we include it anyway
+in a bitmask used with INCLUDE values, so that standard tuple deconstruction
+code can be used.
NULLS HANDLING