Skip to content

Commit 1a219fa

Browse files
committed
Add header comments to execParallel.c and nodeGather.c.
Patch by me, per a note from Simon Riggs. Reviewed by Amit Kapila and Amit Langote.
1 parent e4a618a commit 1a219fa

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/backend/executor/execParallel.c

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9+
* This file contains routines that are intended to support setting up,
10+
* using, and tearing down a ParallelContext from within the PostgreSQL
11+
* executor. The ParallelContext machinery will handle starting the
12+
* workers and ensuring that their state generally matches that of the
13+
* leader; see src/backend/access/transam/README.parallel for details.
14+
* However, we must save and restore relevant executor state, such as
15+
* any ParamListInfo associated with the query, buffer usage info, and
16+
* the actual plan to be passed down to the worker.
917
*
1018
* IDENTIFICATION
1119
* src/backend/executor/execParallel.c

src/backend/executor/nodeGather.c

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9+
* A Gather executor launches parallel workers to run multiple copies of a
10+
* plan. It can also run the plan itself, if the workers are not available
11+
* or have not started up yet. It then merges all of the results it produces
12+
* and the results from the workers into a single output stream. Therefore,
13+
* it will normally be used with a plan where running multiple copies of the
14+
* same plan does not produce duplicate output, such as PartialSeqScan.
15+
*
16+
* Alternatively, a Gather node can be configured to use just one worker
17+
* and the single-copy flag can be set. In this case, the Gather node will
18+
* run the plan in one worker and will not execute the plan itself. In
19+
* this case, it simply returns whatever tuples were returned by the worker.
20+
* If a worker cannot be obtained, then it will run the plan itself and
21+
* return the results. Therefore, a plan used with a single-copy Gather
22+
* node need not be parallel-aware.
923
*
1024
* IDENTIFICATION
1125
* src/backend/executor/nodeGather.c

0 commit comments

Comments
 (0)