pg_plan_advice: Don't generate FOREIGN_JOIN advice for a single relation.
Robert Haas <rhaas@postgresql.org>
pg_plan_advice: Don't generate FOREIGN_JOIN advice for a single relation. A foreign scan can target a single relation while still reaching the fs_relids branch of pgpa_build_scan() -- for example, when postgres_fdw pushes an aggregate down over one foreign table. In that case, no advice should be emitted. Author: Mahendra Singh Thalor <mahi6run@gmail.com> Co-authored-by: Robert Haas <rhaas@postgresql.org> Discussion: http://postgr.es/m/CAKYtNAofuAJBz6++SeikpCb=Y=MO1QgEuZNJ+KZOP2johF1r4Q@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_plan_advice/Makefile | modified | +3 −1 |
| contrib/pg_plan_advice/meson.build | modified | +5 −0 |
| contrib/pg_plan_advice/pgpa_scan.c | modified | +6 −2 |
| contrib/pg_plan_advice/t/001_foreign_scan.pl | added | +83 −0 |
Discussion
- pg_plan_advice: FOREIGN_JOIN advice generated for a single-relation foreign scan is not round-trip safe 6 messages · 2026-06-30 → 2026-07-03