Skip to content

Commit e976cc4

Browse files
committed
doc: Replace some uses of "which" by "that" in parallel.sgml
This makes the documentation more accurate grammatically. Author: Elena Indrupskaya Discussion: https://postgr.es/m/1c994b3d-951e-59bb-1ac2-7b9221c0e4cf@postgrespro.ru Backpatch-through: 9.6
1 parent b51985d commit e976cc4

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

doc/src/sgml/parallel.sgml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</indexterm>
99

1010
<para>
11-
<productname>PostgreSQL</productname> can devise query plans which can leverage
11+
<productname>PostgreSQL</productname> can devise query plans that can leverage
1212
multiple CPUs in order to answer queries faster. This feature is known
1313
as parallel query. Many queries cannot benefit from parallel query, either
1414
due to limitations of the current implementation or because there is no
15-
imaginable query plan which is any faster than the serial query plan.
15+
imaginable query plan that is any faster than the serial query plan.
1616
However, for queries that can benefit, the speedup from parallel query
1717
is often very significant. Many queries can run more than twice as fast
1818
when using parallel query, and some queries can run four times faster or
@@ -27,7 +27,7 @@
2727

2828
<para>
2929
When the optimizer determines that parallel query is the fastest execution
30-
strategy for a particular query, it will create a query plan which includes
30+
strategy for a particular query, it will create a query plan that includes
3131
a <firstterm>Gather</firstterm> or <firstterm>Gather Merge</firstterm>
3232
node. Here is a simple example:
3333

@@ -59,7 +59,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
5959
<para>
6060
<link linkend="using-explain">Using EXPLAIN</link>, you can see the number of
6161
workers chosen by the planner. When the <literal>Gather</literal> node is reached
62-
during query execution, the process which is implementing the user's
62+
during query execution, the process that is implementing the user's
6363
session will request a number of <link linkend="bgworker">background
6464
worker processes</link> equal to the number
6565
of workers chosen by the planner. The number of background workers that
@@ -79,7 +79,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
7979
</para>
8080

8181
<para>
82-
Every background worker process which is successfully started for a given
82+
Every background worker process that is successfully started for a given
8383
parallel query will execute the parallel portion of the plan. The leader
8484
will also execute that portion of the plan, but it has an additional
8585
responsibility: it must also read all of the tuples generated by the
@@ -88,7 +88,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
8888
worker, speeding up query execution. Conversely, when the parallel portion
8989
of the plan generates a large number of tuples, the leader may be almost
9090
entirely occupied with reading the tuples generated by the workers and
91-
performing any further processing steps which are required by plan nodes
91+
performing any further processing steps that are required by plan nodes
9292
above the level of the <literal>Gather</literal> node or
9393
<literal>Gather Merge</literal> node. In such cases, the leader will
9494
do very little of the work of executing the parallel portion of the plan.
@@ -109,7 +109,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
109109
<title>When Can Parallel Query Be Used?</title>
110110

111111
<para>
112-
There are several settings which can cause the query planner not to
112+
There are several settings that can cause the query planner not to
113113
generate a parallel query plan under any circumstances. In order for
114114
any parallel query plans whatsoever to be generated, the following
115115
settings must be configured as indicated.
@@ -119,7 +119,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
119119
<listitem>
120120
<para>
121121
<xref linkend="guc-max-parallel-workers-per-gather"/> must be set to a
122-
value which is greater than zero. This is a special case of the more
122+
value that is greater than zero. This is a special case of the more
123123
general principle that no more workers should be used than the number
124124
configured via <varname>max_parallel_workers_per_gather</varname>.
125125
</para>
@@ -145,7 +145,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
145145
contains a data-modifying operation either at the top level or within
146146
a CTE, no parallel plans for that query will be generated. As an
147147
exception, the commands <literal>CREATE TABLE ... AS</literal>, <literal>SELECT
148-
INTO</literal>, and <literal>CREATE MATERIALIZED VIEW</literal> which create a new
148+
INTO</literal>, and <literal>CREATE MATERIALIZED VIEW</literal> that create a new
149149
table and populate it can use a parallel plan.
150150
</para>
151151
</listitem>
@@ -240,7 +240,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
240240
than normal but would produce incorrect results. Instead, the parallel
241241
portion of the plan must be what is known internally to the query
242242
optimizer as a <firstterm>partial plan</firstterm>; that is, it must be constructed
243-
so that each process which executes the plan will generate only a
243+
so that each process that executes the plan will generate only a
244244
subset of the output rows in such a way that each required output row
245245
is guaranteed to be generated by exactly one of the cooperating processes.
246246
Generally, this means that the scan on the driving table of the query
@@ -350,11 +350,11 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
350350

351351
<para>
352352
Because the <literal>Finalize Aggregate</literal> node runs on the leader
353-
process, queries which produce a relatively large number of groups in
353+
process, queries that produce a relatively large number of groups in
354354
comparison to the number of input rows will appear less favorable to the
355355
query planner. For example, in the worst-case scenario the number of
356356
groups seen by the <literal>Finalize Aggregate</literal> node could be as many as
357-
the number of input rows which were seen by all worker processes in the
357+
the number of input rows that were seen by all worker processes in the
358358
<literal>Partial Aggregate</literal> stage. For such cases, there is clearly
359359
going to be no performance benefit to using parallel aggregation. The
360360
query planner takes this into account during the planning process and is
@@ -410,7 +410,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
410410
involve appending multiple results sets can therefore achieve
411411
coarse-grained parallelism even when efficient partial plans are not
412412
available. For example, consider a query against a partitioned table
413-
which can only be implemented efficiently by using an index that does
413+
that can only be implemented efficiently by using an index that does
414414
not support parallel scans. The planner might choose a <literal>Parallel
415415
Append</literal> of regular <literal>Index Scan</literal> plans; each
416416
individual index scan would have to be executed to completion by a single
@@ -431,7 +431,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
431431
If a query that is expected to do so does not produce a parallel plan,
432432
you can try reducing <xref linkend="guc-parallel-setup-cost"/> or
433433
<xref linkend="guc-parallel-tuple-cost"/>. Of course, this plan may turn
434-
out to be slower than the serial plan which the planner preferred, but
434+
out to be slower than the serial plan that the planner preferred, but
435435
this will not always be the case. If you don't get a parallel
436436
plan even with very small values of these settings (e.g., after setting
437437
them both to zero), there may be some reason why the query planner is
@@ -458,15 +458,15 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
458458
<para>
459459
The planner classifies operations involved in a query as either
460460
<firstterm>parallel safe</firstterm>, <firstterm>parallel restricted</firstterm>,
461-
or <firstterm>parallel unsafe</firstterm>. A parallel safe operation is one which
461+
or <firstterm>parallel unsafe</firstterm>. A parallel safe operation is one that
462462
does not conflict with the use of parallel query. A parallel restricted
463-
operation is one which cannot be performed in a parallel worker, but which
463+
operation is one that cannot be performed in a parallel worker, but that
464464
can be performed in the leader while parallel query is in use. Therefore,
465465
parallel restricted operations can never occur below a <literal>Gather</literal>
466-
or <literal>Gather Merge</literal> node, but can occur elsewhere in a plan which
467-
contains such a node. A parallel unsafe operation is one which cannot
466+
or <literal>Gather Merge</literal> node, but can occur elsewhere in a plan that
467+
contains such a node. A parallel unsafe operation is one that cannot
468468
be performed while parallel query is in use, not even in the leader.
469-
When a query contains anything which is parallel unsafe, parallel query
469+
When a query contains anything that is parallel unsafe, parallel query
470470
is completely disabled for that query.
471471
</para>
472472

@@ -490,7 +490,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
490490
<listitem>
491491
<para>
492492
Scans of foreign tables, unless the foreign data wrapper has
493-
an <literal>IsForeignScanParallelSafe</literal> API which indicates otherwise.
493+
an <literal>IsForeignScanParallelSafe</literal> API that indicates otherwise.
494494
</para>
495495
</listitem>
496496

@@ -502,7 +502,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
502502

503503
<listitem>
504504
<para>
505-
Plan nodes which reference a correlated <literal>SubPlan</literal>.
505+
Plan nodes that reference a correlated <literal>SubPlan</literal>.
506506
</para>
507507
</listitem>
508508
</itemizedlist>
@@ -513,7 +513,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
513513
<para>
514514
The planner cannot automatically determine whether a user-defined
515515
function or aggregate is parallel safe, parallel restricted, or parallel
516-
unsafe, because this would require predicting every operation which the
516+
unsafe, because this would require predicting every operation that the
517517
function could possibly perform. In general, this is equivalent to the
518518
Halting Problem and therefore impossible. Even for simple functions
519519
where it could conceivably be done, we do not try, since this would be expensive
@@ -531,11 +531,11 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
531531
<para>
532532
Functions and aggregates must be marked <literal>PARALLEL UNSAFE</literal> if
533533
they write to the database, access sequences, change the transaction state
534-
even temporarily (e.g., a PL/pgSQL function which establishes an
534+
even temporarily (e.g., a PL/pgSQL function that establishes an
535535
<literal>EXCEPTION</literal> block to catch errors), or make persistent changes to
536536
settings. Similarly, functions must be marked <literal>PARALLEL
537537
RESTRICTED</literal> if they access temporary tables, client connection state,
538-
cursors, prepared statements, or miscellaneous backend-local state which
538+
cursors, prepared statements, or miscellaneous backend-local state that
539539
the system cannot synchronize across workers. For example,
540540
<literal>setseed</literal> and <literal>random</literal> are parallel restricted for
541541
this last reason.
@@ -553,10 +553,10 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
553553
</para>
554554

555555
<para>
556-
If a function executed within a parallel worker acquires locks which are
556+
If a function executed within a parallel worker acquires locks that are
557557
not held by the leader, for example by querying a table not referenced in
558558
the query, those locks will be released at worker exit, not end of
559-
transaction. If you write a function which does this, and this behavior
559+
transaction. If you write a function that does this, and this behavior
560560
difference is important to you, mark such functions as
561561
<literal>PARALLEL RESTRICTED</literal>
562562
to ensure that they execute only in the leader.

0 commit comments

Comments
 (0)