• Robert Haas's avatar
    Add a Gather executor node. · 3bd909b2
    Robert Haas authored
    A Gather executor node runs any number of copies of a plan in an equal
    number of workers and merges all of the results into a single tuple
    stream.  It can also run the plan itself, if the workers are
    unavailable or haven't started up yet.  It is intended to work with
    the Partial Seq Scan node which will be added in future commits.
    
    It could also be used to implement parallel query of a different sort
    by itself, without help from Partial Seq Scan, if the single_copy mode
    is used.  In that mode, a worker executes the plan, and the parallel
    leader does not, merely collecting the worker's results.  So, a Gather
    node could be inserted into a plan to split the execution of that plan
    across two processes.  Nested Gather nodes aren't currently supported,
    but we might want to add support for that in the future.
    
    There's nothing in the planner to actually generate Gather nodes yet,
    so it's not quite time to break out the champagne.  But we're getting
    close.
    
    Amit Kapila.  Some designs suggestions were provided by me, and I also
    reviewed the patch.  Single-copy mode, documentation, and other minor
    changes also by me.
    3bd909b2
execParallel.c 18.8 KB