aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/allpaths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r--src/backend/optimizer/path/allpaths.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 7af001feaac..eea49cca7bb 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -1350,14 +1350,17 @@ add_paths_to_append_rel(PlannerInfo *root, RelOptInfo *rel,
/*
* When the planner is considering cheap startup plans, we'll also
- * collect all the cheapest_startup_paths and build an AppendPath
- * containing those as subpaths.
+ * collect all the cheapest_startup_paths (if set) and build an
+ * AppendPath containing those as subpaths.
*/
- if (rel->consider_startup && childrel->pathlist != NIL &&
- childrel->cheapest_startup_path->param_info == NULL)
+ if (rel->consider_startup && childrel->cheapest_startup_path != NULL)
+ {
+ /* cheapest_startup_path must not be a parameterized path. */
+ Assert(childrel->cheapest_startup_path->param_info == NULL);
accumulate_append_subpath(childrel->cheapest_startup_path,
&startup_subpaths,
NULL);
+ }
else
startup_subpaths_valid = false;