Re: IS NOT DISTINCT FROM statement - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: IS NOT DISTINCT FROM statement
Date
Msg-id 9d4c7b0de250db9aef716600ca6e39652738ff4e.camel@cybertec.at
Whole thread Raw
In response to IS NOT DISTINCT FROM statement  (Artur Zając <azajac@ang.com.pl>)
List 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 by date:

Previous
From: Artur Zając
Date:
Subject: IS NOT DISTINCT FROM statement
Next
From: David Rowley
Date:
Subject: Re: IS NOT DISTINCT FROM statement