| From: | David Rowley <dgrowleyml(at)gmail(dot)com> |
|---|---|
| To: | 陈列行 <2320415112(at)qq(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: redundant double negation prevents IN-subquery pull-up and causes a slower SubPlan |
| Date: | 2026-08-17 09:00:02 |
| Message-ID: | CAApHDvqermwLoXd4i9J7WowdTGDk4T8DFminkdLgWX=ds5j19A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, 17 Aug 2026 at 20:16, 陈列行 <2320415112(at)qq(dot)com> 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniel Gustafsson | 2026-08-17 09:03:31 | Re: basebackup: do not verify checksums on pages written before enabling checksums |
| Previous Message | David Rowley | 2026-08-17 08:40:41 | Re: PostgreSQL does not propagate empty inputs through INTERSECT and EXCEPT |