Skip site navigation (1) Skip section navigation (2)

NULL's support in SP-GiST

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: NULL's support in SP-GiST
Date: 2012-02-02 21:26:13
Message-ID: Pine.LNX.4.64.1201312034280.12612@sn.sai.msu.ru (view raw or flat)
Thread:
Lists: pgsql-hackers
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 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.




 	Regards,
 		Oleg
_____________________________________________________________
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

Attachment: spgist_null-0.8.gz
Description: application/octet-stream (12.0 KB)

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-02-02 21:44:10
Subject: Re: BUG #6425: Bus error in slot_deform_tuple
Previous:From: Bernd HelmleDate: 2012-02-02 21:08:35
Subject: Re: pg_stats_recovery view

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group