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

Re: Null values in indexes

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)tm(dot)ee>, Dann Corbit <DCorbit(at)connx(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Null values in indexes
Date: 2002-05-29 14:38:37
Message-ID: 200205291438.g4TEcbb19114@saturn.janwieck.net (view raw or flat)
Thread:
Lists: pgsql-hackers
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.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck(at)Yahoo(dot)com #



In response to

Responses

pgsql-hackers by date

Next:From: Kenneth ChanDate: 2002-05-29 14:44:53
Subject: Re: Polygons passed to poly_overlap have 0 pts when
Previous:From: Tom LaneDate: 2002-05-29 12:47:23
Subject: Re: Backend died abnormally

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