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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Add support for IS NULL to btree indexes
Дата
Msg-id 29458.1127162007@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PATCH] Add support for IS NULL to btree indexes  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: [PATCH] Add support for IS NULL to btree indexes  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-patches
Martijn van Oosterhout <kleptog@svana.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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: [PATCH] Add support for IS NULL to btree indexes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: doc/FAQ_DEV: about profile