pg_plan_advice: Don't generate FOREIGN_JOIN advice for a single relation.

Robert Haas <rhaas@postgresql.org>

Commit: 53e6f51eef55e8e4520901e40b4d143d944358c0
Author: Robert Haas <rhaas@postgresql.org>
Date: 2026-07-02T19:45:22Z
Releases: master
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

Discussion