Re: BUG #18442: Unnecessary Sort operator in indexScan Plan - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Date
Msg-id CAMbWs4-jV8sr7pR3wzhe0YngYjuqbxXkbfbRqTnaZ1iikcPgCQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18442: Unnecessary Sort operator in indexScan Plan  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-bugs

On Mon, Apr 22, 2024 at 9:53 AM David Rowley <dgrowleyml@gmail.com> wrote:
Presumably, if a=b is strict then effectively nothing could match as
the strict qual ensures NULLs never match and the IS NULL only allows
NULLs.

Yeah, in this case the two restrictions are self-inconsistent and that
makes the relation dummy and need not be scanned.  I think the planner
would figure that out in relation_excluded_by_constraints when the GUC
constraint_exclusion is on, but in a different way than ECs.

Thanks
Richard

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #15954: Unable to alter partitioned table to set logged