Re: Null values in indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <janwieck(at)yahoo(dot)com>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)stack(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Null values in indexes
Date: 2002-05-29 16:07:21
Message-ID: 23920.1022688441@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck <janwieck(at)yahoo(dot)com> writes:
> Tom Lane wrote:
>> Hannu Krosing <hannu(at)tm(dot)ee> writes:
> How hard would it be to _not_ include nulls in indexes
> as they are not used anyway.
>>
>> Seems to me that would be a step backwards.

> It would cause multi-key indexes beeing unusable for partial
> key lookup. Imagine you have a key over (a, b, c) and query
> with WHERE a = 1 AND b = 2. This query cannot use the index
> if a NULL value in c would cause the index entry to be
> suppressed.

Urgh ... that means GiST indexing is actually broken, because GiST
currently handles multicolumns but not nulls. AFAIR the planner
will try to use partial qualification on any multicolumn index...
it had better avoid doing so for non-null-capable AMs.

Alternatively, we could fix GiST to support nulls. Oleg, Teodor:
how far away might that be?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dann Corbit 2002-05-29 17:00:03 Re: Null values in indexes
Previous Message Kenneth Chan 2002-05-29 14:44:53 Re: Polygons passed to poly_overlap have 0 pts when