Re: BUG #17545: Incorrect selectivity for IS NOT DISTINCT FROM and NULLs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: rpsalmi(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17545: Incorrect selectivity for IS NOT DISTINCT FROM and NULLs
Date: 2022-07-12 04:41:46
Message-ID: 1385220.1657600906@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Richard Guo <guofenglinux(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2022-07-12 04:57:35 Reducing chunk header sizes on all memory context types
Previous Message Richard Guo 2022-07-12 04:35:48 Re: BUG #17545: Incorrect selectivity for IS NOT DISTINCT FROM and NULLs