Re: BUG #19007: Planner fails to choose partial index with spurious 'not null' - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #19007: Planner fails to choose partial index with spurious 'not null'
Date
Msg-id CAMbWs4-rmHTz0Txt813WUpZe_5U9DEPMRVsFiVFs2C4TXJ8qiA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19007: Planner fails to choose partial index with spurious 'not null'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Mon, Aug 4, 2025 at 2:19 AM Tom Lane <tgl@sss.pgh.pa.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



pgsql-bugs by date:

Previous
From: Richard Guo
Date:
Subject: Re: BUG #19007: Planner fails to choose partial index with spurious 'not null'
Next
From: Daniil Davydov
Date:
Subject: Re: BUG #16961: Could not access status of transaction