Re: BUG #19007: Planner fails to choose partial index with spurious 'not null'

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: bryfox(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19007: Planner fails to choose partial index with spurious 'not null'
Date: 2025-08-04 09:24:37
Message-ID: CAMbWs4-rmHTz0Txt813WUpZe_5U9DEPMRVsFiVFs2C4TXJ8qiA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Aug 4, 2025 at 2:19 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> (I'm also quite displeased that e2debb643 didn't nuke
> restriction_is_always_true/false. But that's a separate discussion.)

Hmm, I tried to do that in e2debb643, but failed, as the commit
message explains:

Note that this patch does not get rid of restriction_is_always_true
and restriction_is_always_false. Removing them would prevent us from
reducing some IS [NOT] NULL quals that we were previously able to
reduce, because (a) the self-join elimination may introduce new IS NOT
NULL quals after constant folding, and (b) if some outer joins are
converted to inner joins, previously irreducible NullTest quals may
become reducible.

Thanks
Richard

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniil Davydov 2025-08-04 11:08:44 Re: BUG #16961: Could not access status of transaction
Previous Message Richard Guo 2025-08-04 09:14:32 Re: BUG #19007: Planner fails to choose partial index with spurious 'not null'