pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_plan_advice: Handle custom scans that replace a join
2+ messages / 1 participants
[nested] [flat]

* pgsql: pg_plan_advice: Handle custom scans that replace a join
@ 2026-11-03 15:28  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2026-11-03 15:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_plan_advice: Handle custom scans that replace a join

pgpa_relids() ignored CustomScan nodes, so a custom scan that replaced
a join caused the plan walker failed with "plan node has no RTIs". Fix
by returning custom_relids, so that the node is then treated as an
ordinary scan of several relations.  This allows JOIN_ORDER advice to
handle it correctly.

Reported-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/20260827171830.68.noahmisch@microsoft.com
Discussion: https://postgr.es/m/sSMpyoJ12CV5Y3uS-T_8Z3M1xsJBELBd-Vh5DmlC9_jy9TOqMuWzr8-TuXrBpL8AlPlyEFkyQ4wX5guJ...
Author: Dongpo Liu <poe.liu@pm.me>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/eaa5961efc65d3701ccae3d7ed79d421e37cdd9f

Modified Files
--------------
contrib/pg_plan_advice/pgpa_walker.c | 2 ++
1 file changed, 2 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: pg_plan_advice: Handle custom scans that replace a join
@ 2026-11-03 15:28  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2026-11-03 15:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_plan_advice: Handle custom scans that replace a join

pgpa_relids() ignored CustomScan nodes, so a custom scan that replaced
a join caused the plan walker failed with "plan node has no RTIs". Fix
by returning custom_relids, so that the node is then treated as an
ordinary scan of several relations.  This allows JOIN_ORDER advice to
handle it correctly.

Reported-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/20260827171830.68.noahmisch@microsoft.com
Discussion: https://postgr.es/m/sSMpyoJ12CV5Y3uS-T_8Z3M1xsJBELBd-Vh5DmlC9_jy9TOqMuWzr8-TuXrBpL8AlPlyEFkyQ4wX5guJ...
Author: Dongpo Liu <poe.liu@pm.me>

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e33700c767080b0cf30f36405f0b09c3c7a5a3a3

Modified Files
--------------
contrib/pg_plan_advice/pgpa_walker.c | 2 ++
1 file changed, 2 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-11-03 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 15:28 pgsql: pg_plan_advice: Handle custom scans that replace a join Robert Haas <rhaas@postgresql.org>
2026-11-03 15:28 pgsql: pg_plan_advice: Handle custom scans that replace a join Robert Haas <rhaas@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox