Re: BUG #18905: The opposite WHERE clause intersects and is always an empty set. It should perform no action.
Christophe Pettus <xof@thebuild.com>
From: Christophe Pettus <xof@thebuild.com>
To: 赖锦辉 <jh.lai@qq.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-04-27T19:19:59Z
Lists: pgsql-bugs
> On Apr 27, 2025, at 10:54, 赖锦辉 <jh.lai@qq.com> wrote: > But I don't believe this optimization is meaningless. I don't believe anyone claims this is "meaningless." Every condition the planner has to check for adds complexity and time to the planner. If this will provide a significant improvement in plans for a reasonable number of real-life cases, then it might well be worth it. This is especially true when there is no way of writing the query without running into the issue. However, many proposed improvements optimize for a relatively uncommon case, but would add time and complexity for all queries. In this case, it appears that this case is relatively uncommon, and it can be easily fixed by rewriting the query. Given that the project does not have infinite resources to dedicate to planner improvements, it does not seem to be an area that would reward the work put into it.