diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index e6aa21c..ce812b0 100644
*** a/src/backend/optimizer/path/joinpath.c
--- b/src/backend/optimizer/path/joinpath.c
*************** try_nestloop_path(PlannerInfo *root,
*** 291,299 ****
  	if (required_outer &&
  		!bms_overlap(required_outer, param_source_rels))
  	{
! 		/* Waste no memory when we reject a path here */
! 		bms_free(required_outer);
! 		return;
  	}
  
  	/*
--- 291,320 ----
  	if (required_outer &&
  		!bms_overlap(required_outer, param_source_rels))
  	{
! 		/*
! 		 * We override the param_source_rels heuristic to accept nestloop
! 		 * paths in which the outer rel satisfies some but not all of the
! 		 * inner path's parameterization.  This is necessary to get good plans
! 		 * for star-schema scenarios, in which a parameterized path for a
! 		 * "fact" table may require parameters from multiple "dimension"
! 		 * tables that will not get joined directly to each other.  We can
! 		 * handle that by stacking nestloops that have the dimension tables on
! 		 * the outside; but this breaks the rule the param_source_rels
! 		 * heuristic is based on, that parameters should not be passed down
! 		 * across joins unless there's a join-order-constraint-based reason to
! 		 * do so.  So, we should consider partial satisfaction of
! 		 * parameterization as another reason to allow such paths.
! 		 */
! 		Relids		outerrelids = outer_path->parent->relids;
! 		Relids		innerparams = PATH_REQ_OUTER(inner_path);
! 
! 		if (!(bms_overlap(innerparams, outerrelids) &&
! 			  bms_nonempty_difference(innerparams, outerrelids)))
! 		{
! 			/* Waste no memory when we reject a path here */
! 			bms_free(required_outer);
! 			return;
! 		}
  	}
  
  	/*
