On Mon, 17 Aug 2026 at 20:16, 陈列行 <[email protected]> wrote: > ### Expected Behaviour > > PostgreSQL should remove double negation before subquery planning and > produce the same semijoin plan as the unwrapped `IN` predicate.
This seems to be a duplicate of what you reported in bug #19570. Just to make you aware, we don't claim to have implemented every possible optimisation in the query planner. If you want to work on any of the optimisations you've mentioned in the set of emails you just sent, please feel free. For this particular optimisation, I really doubt we'd ever do anything for that one case unless it happened to become optimised as a side-effect of something larger and more useful project. So, I don't suggest you work on such a narrow optimisation with the expectation that it would be accepted in that narrow form. I'd probably classify this one as more useful to keep so that someone can prevent the planner from choosing a Semi Join plan. It seems akin to the "col + 0" trick to prevent index or statistics usage on col. David
