David Rowley <dgrowleyml@gmail.com> writes:
> Couldn't strict equality conditions be handled using the same method
> that we use to handle an Eclass with two distinct Consts. e.g a = 1
> and a=b and b=2?
Perhaps, but it'd be a bit odd and confusing to treat two NULLs as
distinct rather than equal.
On the whole I'm disinclined to add complexity around this. My gut
says there are more semantic gotchas than this one, and I think the
use-case is at best pretty hokey. If your data design requires using
NULL as though it's a normal data value, you're in a state of sin
already, and you're going to find SQL fighting you all the way.
(A question closely related to this is whether IS NOT DISTINCT FROM
could be optimized more like regular equality. I'm not convinced
about the use-case there either, although perhaps it's worth looking
into.)
regards, tom lane