/*
* 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;
-> Result
(8 rows)
+-- Ensure there is no problem if cheapest_startup_path is NULL
+explain (costs off)
+select * from tenk1 t1
+left join lateral
+ (select t1.tenthous from tenk2 t2 union all (values(1)))
+on true limit 1;
+ QUERY PLAN
+-------------------------------------------------------------------
+ Limit
+ -> Nested Loop Left Join
+ -> Seq Scan on tenk1 t1
+ -> Append
+ -> Index Only Scan using tenk2_hundred on tenk2 t2
+ -> Result
+(6 rows)
+
select t1.unique1 from tenk1 t1
inner join tenk2 t2 on t1.tenthous = t2.tenthous
union all
-(values(1)) limit 1;
\ No newline at end of file
+(values(1)) limit 1;
+
+-- Ensure there is no problem if cheapest_startup_path is NULL
+explain (costs off)
+select * from tenk1 t1
+left join lateral
+ (select t1.tenthous from tenk2 t2 union all (values(1)))
+on true limit 1;