pgsql: pg_plan_advice: Handle custom scans that replace a join

Started by Robert Haas26 days ago1 messagescommitters
Jump to latest
#1Robert Haas
rhaas@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: /messages/by-id/20260827171830.68.noahmisch@microsoft.com
Discussion: /messages/by-id/sSMpyoJ12CV5Y3uS-T_8Z3M1xsJBELBd-Vh5DmlC9_jy9TOqMuWzr8-TuXrBpL8AlPlyEFkyQ4wX5guJCyVizY-R2UET0DpIEeA1aSsUjk4=@pm.me
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(+)