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 <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Discussion: 
https://postgr.es/m/sSMpyoJ12CV5Y3uS-T_8Z3M1xsJBELBd-Vh5DmlC9_jy9TOqMuWzr8-TuXrBpL8AlPlyEFkyQ4wX5guJCyVizY-R2UET0DpIEeA1aSsUjk4=@pm.me
Author: Dongpo Liu <[email protected]>

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(+)

Reply via email to