Hi there, attached patch introduces NULLs indexing for SP-GiST. With this patch Sp-GiST supports IS NULL, IS NOT NULL clauses, as well as full index scan.
We added boolean satisfyAll field in spgInnerConsistentIn and spgLeafConsistentIn structures, which informs the user-defined methods, that all search results satisfy a query and should be returned. Calls of consistent methods are
needed because they know how to reconstruct an original value. Unlike BTree we can't introduce a rule like "NULL is greater than anything else", because Sp-GiST doesn't know semantics of indexed data. Also, Sp-GiST is essentially single-column index, so we canstore null values outside the main structure of index and use separate code path to work with NULLs. Actually, storing just ItemPointer (instead of the whole index tuple) is enough for NULLs, so we can reuse data tree storage from GIN, which used for storing ItemPointers for each indexed values. For that purpose, GinPageOpaqueData and SpGistPageOpaqueData should be compatible, at least at flag's positions and values. In fact, it's needed only for vacuum code, which produces full index scan.
Regards, Oleg _____________________________________________________________ Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru), Sternberg Astronomical Institute, Moscow University, Russia Internet: o...@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(495)939-16-83, +007(495)939-23-83
spgist_null-0.8.gz
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers