diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-03-11 16:29:04 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-03-11 16:29:59 -0400 |
commit | c6a11b89e48dfb47b305cea405924333dabc20b6 (patch) | |
tree | 1ef16196fa824d0515789c59f34e46e829a43966 /doc/src | |
parent | fc227a4e3b84f7bc243c4606780dde28aea257ee (diff) | |
download | postgresql-c6a11b89e48dfb47b305cea405924333dabc20b6.tar.gz postgresql-c6a11b89e48dfb47b305cea405924333dabc20b6.zip |
Teach SPGiST to store nulls and do whole-index scans.
This patch fixes the other major compatibility-breaking limitation of
SPGiST, that it didn't store anything for null values of the indexed
column, and so could not support whole-index scans or "x IS NULL"
tests. The approach is to create a wholly separate search tree for
the null entries, and use fixed "allTheSame" insertion and search
rules when processing this tree, instead of calling the index opclass
methods. This way the opclass methods do not need to worry about
dealing with nulls.
Catversion bump is for pg_am updates as well as the change in on-disk
format of SPGiST indexes; there are some tweaks in SPGiST WAL records
as well.
Heavily rewritten version of a patch by Oleg Bartunov and Teodor Sigaev.
(The original also stored nulls separately, but it reused GIN code to do
so; which required undesirable compromises in the on-disk format, and
would likely lead to bugs due to the GIN code being required to work in
two very different contexts.)
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/spgist.sgml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml index 0202dbcdd5a..fd312cf4368 100644 --- a/doc/src/sgml/spgist.sgml +++ b/doc/src/sgml/spgist.sgml @@ -100,6 +100,18 @@ value when that is needed. </para> + <note> + <para> + The <acronym>SP-GiST</acronym> core code takes care of NULL entries. + Although <acronym>SP-GiST</acronym> indexes do store entries for nulls + in indexed columns, this is hidden from the index operator class code: + no null index entries or search conditions will ever be passed to the + operator class methods. (It is assumed that <acronym>SP-GiST</acronym> + operators are strict and so cannot succeed for NULL values.) NULLs + are therefore not discussed further here. + </para> + </note> + <para> There are five user-defined methods that an index operator class for <acronym>SP-GiST</acronym> must provide. All five follow the convention |