pg_plan_advice: Fix a bug when a subquery is pruned away entirely.
Robert Haas <rhaas@postgresql.org>
pg_plan_advice: Fix a bug when a subquery is pruned away entirely. If a subquery is proven empty, and if that subquery contained a semijoin, and if making one side or the other of that semijoin unique and performing an inner join was a possible strategy, then the previous code would fail with ERROR: no rtoffset for plan %s when attempting to generate advice. Fix that. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: http://postgr.es/m/CA+TgmobOOmmXSJz3e+cjTY-bA1+W0dqVDqzxUBEvGtW62whYGg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_plan_advice/expected/semijoin.out | modified | +17 −0 |
| contrib/pg_plan_advice/pgpa_planner.c | modified | +16 −12 |
| contrib/pg_plan_advice/sql/semijoin.sql | modified | +9 −0 |
Discussion
- pg_plan_advice 219 messages · 2025-10-30 → 2026-06-10