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 can
store 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.
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2012-02-02 21:44:10|
|Subject: Re: BUG #6425: Bus error in slot_deform_tuple |
|Previous:||From: Bernd Helmle||Date: 2012-02-02 21:08:35|
|Subject: Re: pg_stats_recovery view|