mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Try again to fix the way the scanjoin_target is used with partial paths.
Commit 04ae11f62e
removed some broken
code to apply the scan/join target to partial paths, but its theory
that this processing step is totally unnecessary turns out to be wrong.
Put similar code back again, but this time, check for parallel-safety
and avoid in-place modifications to paths that may already have been
used as part of some other path.
(This is not an entirely elegant solution to this problem; it might
be better, for example, to postpone generate_gather_paths for the
topmost scan/join rel until after the scan/join target has been
applied. But this is not the time for such redesign work.)
Amit Kapila and Robert Haas
This commit is contained in:
@ -2217,12 +2217,14 @@ create_projection_path(PlannerInfo *root,
|
||||
* 'rel' is the parent relation associated with the result
|
||||
* 'path' is the path representing the source of data
|
||||
* 'target' is the PathTarget to be computed
|
||||
* 'target_parallel' indicates that target expressions are all parallel-safe
|
||||
*/
|
||||
Path *
|
||||
apply_projection_to_path(PlannerInfo *root,
|
||||
RelOptInfo *rel,
|
||||
Path *path,
|
||||
PathTarget *target)
|
||||
PathTarget *target,
|
||||
bool target_parallel)
|
||||
{
|
||||
QualCost oldcost;
|
||||
|
||||
@ -2248,8 +2250,7 @@ apply_projection_to_path(PlannerInfo *root,
|
||||
* project. But if there is something that is not parallel-safe in the
|
||||
* target expressions, then we can't.
|
||||
*/
|
||||
if (IsA(path, GatherPath) &&
|
||||
!has_parallel_hazard((Node *) target->exprs, false))
|
||||
if (IsA(path, GatherPath) &&target_parallel)
|
||||
{
|
||||
GatherPath *gpath = (GatherPath *) path;
|
||||
|
||||
|
Reference in New Issue
Block a user