Re: IS NOT DISTINCT FROM statement

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: IS NOT DISTINCT FROM statement
Дата
Msg-id 9d4c7b0de250db9aef716600ca6e39652738ff4e.camel@cybertec.at
обсуждение исходный текст
Ответ на IS NOT DISTINCT FROM statement  (Artur Zając <azajac@ang.com.pl>)
Список pgsql-performance
Artur Zając wrote:
> Is there any reason that „NOT DISTINCT FROM” can’t be autotransformed to „=” when value
> on right side of expression is not NULL or is this any way to use index with „IS NOT DISTINCT FROM” statement?

That would subtly change the semantics of the expression:

test=> SELECT NULL IS NOT DISTINCT FROM 21580;
 ?column? 
----------
 f
(1 row)

test=> SELECT NULL = 21580;
 ?column? 
----------
 
(1 row)

One expression is FALSE, the other NULL.

It doesn't matter in the context of your specific query, but it could matter.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



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

Предыдущее
От: Artur Zając
Дата:
Сообщение: IS NOT DISTINCT FROM statement
Следующее
От: David Rowley
Дата:
Сообщение: Re: IS NOT DISTINCT FROM statement