generate_partition_wise_join_paths prints debug info, if
OPTIMIZER_DEBUG, using debug_print_rel at the end of each iteration for
collecting non-dummy child-joins, but I noticed that we pass to that
function the parent's RelOptInfo, not such a child-join's RelOptInfo.  I
don't think it's intentional, so here is a patch for fixing that.

Best regards,
Etsuro Fujita
*** a/src/backend/optimizer/path/allpaths.c
--- b/src/backend/optimizer/path/allpaths.c
***************
*** 3457,3463 **** generate_partition_wise_join_paths(PlannerInfo *root, RelOptInfo *rel)
  		set_cheapest(child_rel);
  
  #ifdef OPTIMIZER_DEBUG
! 		debug_print_rel(root, rel);
  #endif
  
  		live_children = lappend(live_children, child_rel);
--- 3457,3463 ----
  		set_cheapest(child_rel);
  
  #ifdef OPTIMIZER_DEBUG
! 		debug_print_rel(root, child_rel);
  #endif
  
  		live_children = lappend(live_children, child_rel);

Reply via email to