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

Re: [PATCH] Add support for IS NULL to btree indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Add support for IS NULL to btree indexes
Date: 2005-09-19 20:33:27
Message-ID: 29458.1127162007@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Actually, it's two changes:
> - In the btree index code, if SK_ISNULL is set, do the right thing
> - If the query has col IS NULL, expand that to col =3D NULL in the index
> quals

This is a bad idea, because it translates "x IS NULL" into "x = NULL"
which is under no circumstances the same thing.  It might coincidentally
fail to malfunction for btree indexes, depending on the specifics of the
"=" operator in use; but that doesn't make it right.  (AFAICS, the
proposed patch simply breaks for non-btree indexes.)  Also, it cannot
handle IS NOT NULL.

A proper solution requires explicitly representing IS NULL/IS NOT NULL
as distinct kinds of scankey.

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-09-20 01:31:48
Subject: Re: doc/FAQ_DEV: about profile
Previous:From: Clark, AndrewDate: 2005-09-19 18:01:03
Subject: Solaris - psql returns 0 instead of 1 for file not found.

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