1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add a Gather executor node.

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.
This commit is contained in:
Robert Haas
2015-09-30 19:23:36 -04:00
parent 227d57f358
commit 3bd909b220
26 changed files with 709 additions and 8 deletions

View File

@ -1928,6 +1928,22 @@ include_dir 'conf.d'
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-max-parallel-degree" xreflabel="max_parallel_degree">
<term><varname>max_parallel_degree</varname> (<type>integer</type>)
<indexterm>
<primary><varname>max_parallel_degree</> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Sets the maximum degree of parallelism for an individual parallel
operation. Note that the requested number of workers may not actually
be available at runtime. Parallel workers are taken from the pool
of processes established by <xref linkend="guc-max-worker-processes">.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>
@ -3398,6 +3414,36 @@ include_dir 'conf.d'
</listitem>
</varlistentry>
<varlistentry id="parallel-tuple-cost" xreflabel="parallel_tuple_cost">
<term><varname>parallel_tuple_cost</varname> (<type>floating point</type>)
<indexterm>
<primary><varname>parallel_tuple_cost</> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Sets the planner's estimate of the cost of transferring a tuple
from a parallel worker process to another process.
The default is 0.1.
</para>
</listitem>
</varlistentry>
<varlistentry id="parallel-setup-cost" xreflabel="parallel_setup_cost">
<term><varname>parallel_setup_cost</varname> (<type>floating point</type>)
<indexterm>
<primary><varname>parallel_setup_cost</> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Sets the planner's estimate of the cost of launching parallel worker
processes.
The default is 1000.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-effective-cache-size" xreflabel="effective_cache_size">
<term><varname>effective_cache_size</varname> (<type>integer</type>)
<indexterm>