mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Remove reltarget_has_non_vars flag.
Commit b12fd41c6
added a "reltarget_has_non_vars" field to RelOptInfo,
but failed to maintain it accurately. Since its only purpose was to skip
calls to has_parallel_hazard() in the simple case where a rel's targetlist
is all Vars, and that call is really pretty cheap in that case anyway, it
seems like this is just a case of premature optimization. Let's drop the
flag and do the calls unconditionally until it's proven that we need more
smarts here.
This commit is contained in:
@ -109,7 +109,6 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind)
|
||||
rel->consider_parallel = false; /* might get changed later */
|
||||
rel->rel_parallel_workers = -1; /* set up in GetRelationInfo */
|
||||
rel->reltarget = create_empty_pathtarget();
|
||||
rel->reltarget_has_non_vars = false;
|
||||
rel->pathlist = NIL;
|
||||
rel->ppilist = NIL;
|
||||
rel->partial_pathlist = NIL;
|
||||
@ -397,7 +396,6 @@ build_join_rel(PlannerInfo *root,
|
||||
joinrel->consider_param_startup = false;
|
||||
joinrel->consider_parallel = false;
|
||||
joinrel->reltarget = create_empty_pathtarget();
|
||||
joinrel->reltarget_has_non_vars = false;
|
||||
joinrel->pathlist = NIL;
|
||||
joinrel->ppilist = NIL;
|
||||
joinrel->partial_pathlist = NIL;
|
||||
@ -520,8 +518,7 @@ build_join_rel(PlannerInfo *root,
|
||||
*/
|
||||
if (inner_rel->consider_parallel && outer_rel->consider_parallel &&
|
||||
!has_parallel_hazard((Node *) restrictlist, false) &&
|
||||
!(joinrel->reltarget_has_non_vars &&
|
||||
has_parallel_hazard((Node *) joinrel->reltarget->exprs, false)))
|
||||
!has_parallel_hazard((Node *) joinrel->reltarget->exprs, false))
|
||||
joinrel->consider_parallel = true;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user