Richard Guo <guofenglinux@gmail.com> writes:
> The comment in the codes has explained this behavior, as it says:
> * This estimation method doesn't give the right behavior for nulls,
> * but it's better than doing nothing.
> So maybe this is a known issue?
It's a nobodys-bothered-to-make-it-better issue. In general, PG's
treatment of IS [NOT] DISTINCT FROM is pretty lame --- for example,
you might wish that IS NOT DISTINCT FROM could use an index in
the way that "=" can, but that's never been made to happen.
regards, tom lane