Re: BUG #18442: Unnecessary Sort operator in indexScan Plan

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, hu_yajun(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Date: 2024-04-22 06:16:08
Message-ID: CAMbWs4-jV8sr7pR3wzhe0YngYjuqbxXkbfbRqTnaZ1iikcPgCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Apr 22, 2024 at 9:53 AM David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-04-22 19:36:20 Re: BUG #15954: Unable to alter partitioned table to set logged
Previous Message Tom Lane 2024-04-22 02:25:42 Re: BUG #18442: Unnecessary Sort operator in indexScan Plan