handling NULLS in GiST

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Teodor Sigaev <teodor(at)stack(dot)net>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: handling NULLS in GiST
Date: 2001-07-16 14:06:44
Message-ID: Pine.GSO.4.33.0107161652310.24835-100000@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom,

we noticed you changed gist.c to handle NULLS. It seems there is
problem with your changes.
in gist.c

/* GIST indexes don't index nulls, see notes in gistinsert */
if (! IndexTupleHasNulls(itup))
{
/*

....... skipped ....

/*
* Currently, GIST indexes do not support indexing NULLs; considerable
* infrastructure work would have to be done to do anything reasonable
* with a NULL.
*/
if (IndexTupleHasNulls(itup))
{

While it's ok for single key but for multikey indexes removing tuple with NULL
looks not right. Consider (a,b,c) where C is NULL. Your changes would
remove tuple and it would be impossible to find (a,b) using this index.
Did you think about this particular case ?

I remind we have choosen to leave NULLs because vacuum complained about
different number of tuples in heap and index and all our opclasses work
correctly with NULLs. Did you change vacuum code so it will not complain ?

In principle, if you insist on your approach, we propose to extend it
to multikey case by removing tuple if and only if leading keys are NULLs

What do you think ?

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2001-07-16 14:43:10 AW: handling NULLS in GiST
Previous Message Larry Rosenman 2001-07-16 12:36:14 NetBSD 1.5.1(HP300)