2121 underlying data changes, the planner normally has the option to adjust the
2222 plan in an attempt to preserve good performance. If the plan advice prevents
2323 this, a very poor plan may be chosen. It is important to use plan advice
24- only when risks of constraining the planner's choices are outweighed by
24+ only when the risks of constraining the planner's choices are outweighed by
2525 the benefits.
2626 </para>
2727
3939 <link linkend="sql-load"><literal>LOAD</literal></link> command. If you
4040 wish to use the
4141 <link linkend="pgplanadvice-collector">collector interface</link>,
42- you must also the <literal>pg_plan_advice</literal> extension
42+ you must also install the <literal>pg_plan_advice</literal> extension
4343 in the database where you wish to use the collector. Use the command
4444 <literal>CREATE EXTENSION pg_plan_advice</literal> to do this. If you do
4545 not wish to use the collector interface, this step is not required.
@@ -157,8 +157,8 @@ EXPLAIN (COSTS OFF)
157157 there is a bug in your advice string, or the plan in question was not
158158 considered viable by the core planner. This commonly happens for one of two
159159 reasons. First, it might be the planner believes that the plan you're trying
160- to force would be semantically incorrect -- that is, it would produce the
161- wrong results -- and for that reason it wasn't considered. Second, it might
160+ to force would be semantically incorrect - that is, it would produce the
161+ wrong results - and for that reason it wasn't considered. Second, it might
162162 be that the planner rejected the plan you were hoping to generate on some
163163 grounds other than cost. For example, given a very simple query such as
164164 <literal>SELECT * FROM some_table</literal>, the query planner will
@@ -218,8 +218,8 @@ EXPLAIN (COSTS OFF)
218218 cases, such as the examples shown above, the advice target is simply the
219219 relation alias. However, a more complex syntax is required when subqueries
220220 are used, when tables are partitioned, or when the same relation alias is
221- mentioned more than once in the same subquery (e.g. <literal>(foo JOIN bar
222- ON foo.a = bar.a) x JOIN foo ON x.b = foo.b</literal>. Any combination of
221+ mentioned more than once in the same subquery (e.g., <literal>(foo JOIN bar
222+ ON foo.a = bar.a) x JOIN foo ON x.b = foo.b</literal>) . Any combination of
223223 these three things can occur simultaneously: a relation could be mentioned
224224 more than once, be partitioned, and be used inside of a subquery.
225225 </para>
@@ -234,22 +234,22 @@ alias_name#occurrence_number/partition_schema.partition_name@plan_name
234234
235235 <para>
236236 All components except for the <literal>alias_name</literal> are optional
237- and included only when required. When a component is omitted, the associated
238- punctuation must also be omitted. For the first occurrence of a table
239- within a given subquery, generated advice will omit the occurrence number,
240- but it is legal to write <literal>#1</literal>, if desired. The partition
241- schema and partition name are included only for children of partitioned
242- tables. In generated advice, we always incude both, but it is legal to
243- omit the schema. The plan name is omitted for the toplevel plan, and must
244- be included for any subplan.
237+ and are included only when required. When a component is omitted, the
238+ preceding punctuation must also be omitted. For the first occurrence of a
239+ table within a given subquery, generated advice will omit the occurrence
240+ number, but it is legal to write <literal>#1</literal>, if desired. The
241+ partition schema and partition name are included only for children of
242+ partitioned tables. In generated advice, <literal>pg_plan_advice</literal>
243+ always includes both, but it is legal to omit the schema. The plan name is
244+ omitted for the top-level plan, and must be included for any subplan.
245245 </para>
246246
247247 <para>
248248 It is not always easy to determine the correct advice target by examining
249- the query; for instance, if the planner pulls up a subquery into the parent
249+ the query. For instance, if the planner pulls up a subquery into the parent
250250 query level, everything inside of it becomes part of the parent query level,
251251 and uses the parent query's subplan name (or no subplan name, if pulled up
252- to the toplevel ). Furthermore, the correct subquery name is sometimes not
252+ to the top level ). Furthermore, the correct subquery name is sometimes not
253253 obvious. For example, when two queries are joined using an operation such as
254254 <literal>UNION</literal> or <literal>INTERSECT</literal>, no name for the
255255 subqueries is present in the SQL syntax; instead, a system-generated name is
@@ -301,9 +301,9 @@ BITMAP_HEAP_SCAN(<replaceable>target</replaceable> [ ... ])</synopsis>
301301 </para>
302302
303303 <para>
304- <literal>FOREIGN_SCAN</literal> specifies that a foreign join between
305- a several foreign tables should be pushed down to a remote server so
306- that it can be implenented as a single <literal>Foreign Scan</literal>.
304+ <literal>FOREIGN_SCAN</literal> specifies that a join between two or
305+ more foreign tables should be pushed down to a remote server so
306+ that it can be implemented as a single <literal>Foreign Scan</literal>.
307307 Specifying <literal>FOREIGN_SCAN</literal> for a single foreign table is
308308 neither necessary nor permissible: a <literal>Foreign Scan</literal> will
309309 need to be used regardless. If you want to prevent a join from being
@@ -348,7 +348,7 @@ JOIN_ORDER(<replaceable>join_order_item</replaceable> [ ... ])
348348 <para>
349349 If a <literal>JOIN_ORDER</literal> list contains a parenthesized sublist,
350350 it specifies a non-outer-deep join. The tables in the sublist must first
351- be joined to each other much as if the sublist were a toplevel
351+ be joined to each other much as if the sublist were a top-level
352352 <literal>JOIN_ORDER</literal> list, and the resulting join product must
353353 then appear on the inner side of a join at the appropriate point in the
354354 join order. For example, <literal>JOIN_ORDER(a (b c) d)</literal> requires
@@ -366,12 +366,12 @@ Join
366366</programlisting>
367367
368368 <para>
369- If a <literal>JOIN_ORDER</literal> list contains a sublist surronded by
369+ If a <literal>JOIN_ORDER</literal> list contains a sublist surrounded by
370370 curly braces, this also specifies a non-outer-deep join. However, the join
371371 order within the sublist is not constrained. For example, specifiying
372- <literal>JOIN_ORDER(a {b c} d</literal> would allow the scans of
372+ <literal>JOIN_ORDER(a {b c} d) </literal> would allow the scans of
373373 <literal>b</literal> and <literal>c</literal> to be swapped in the
374- previous example, which is not allowed when parenthese are used.
374+ previous example, which is not allowed when parentheses are used.
375375 </para>
376376
377377 <para>
@@ -401,21 +401,21 @@ join_method_name(<replaceable>join_method_item</replaceable> [ ... ])
401401
402402<phrase>and <replaceable>join_method_item</replaceable> is:</phrase>
403403
404- <replaceable>advice_target</replaceable> |
404+ { <replaceable>advice_target</replaceable> |
405405( <replaceable>advice_target</replaceable> [ ... ] ) }</synopsis>
406406
407407 <para>
408408 Join method advice specifies the table, or set of tables, that should
409409 appear on the inner side of a join using the named join method. For
410410 example, <literal>HASH_JOIN(a b)</literal> means that each of
411411 <literal>a</literal> and <literal>b</literal> should appear on the inner
412- side of a hash join; a confirming plan must contain at least two hash
412+ side of a hash join; a conforming plan must contain at least two hash
413413 joins, one of which has <literal>a</literal> and nothing else on the
414414 inner side, and the other of which has <literal>b</literal> and nothing
415415 else on the inner side. On the other hand,
416416 <literal>HASH_JOIN((a b))</literal> means that the join product of
417417 <literal>a</literal> and <literal>b</literal> should appear together
418- on the inner side of a a single hash join.
418+ on the inner side of a single hash join.
419419 </para>
420420
421421 <para>
@@ -442,7 +442,7 @@ PARTITIONWISE(<replaceable>partitionwise_item</replaceable> [ ... ])
442442
443443<phrase>where <replaceable>partitionwise_item</replaceable> is:</phrase>
444444
445- <replaceable>advice_target</replaceable> |
445+ { <replaceable>advice_target</replaceable> |
446446( <replaceable>advice_target</replaceable> [ ... ] ) }</synopsis>
447447
448448 <para>
@@ -465,7 +465,7 @@ SEMIJOIN_NON_UNIQUE(<replaceable>sj_unique_item</replaceable> [ ... ])
465465
466466<phrase>where <replaceable>sj_unique_item</replaceable> is:</phrase>
467467
468- <replaceable>advice_target</replaceable> |
468+ { <replaceable>advice_target</replaceable> |
469469( <replaceable>advice_target</replaceable> [ ... ] ) }</synopsis>
470470
471471 <para>
@@ -488,7 +488,7 @@ NO_GATHER(<replaceable>advice_target</replaceable> [ ... ])
488488
489489<phrase>where <replaceable>gather_item</replaceable> is:</phrase>
490490
491- <replaceable>advice_target</replaceable> |
491+ { <replaceable>advice_target</replaceable> |
492492( <replaceable>advice_target</replaceable> [ ... ] ) }</synopsis>
493493
494494 <para>
@@ -559,7 +559,7 @@ rhaas=# EXPLAIN (COSTS OFF)
559559 <literal>HASH_JOIN(f g)</literal> is actually a request for two logically
560560 separate behaviors, whereas <literal>JOIN_ORDER(f g)</literal> is a single
561561 request. When providing advice feedback, <literal>EXPLAIN</literal> shows
562- each logical request separtely , together with all the feedback applicable
562+ each logical request separately , together with all the feedback applicable
563563 to that request type.
564564 </para>
565565
@@ -579,15 +579,15 @@ rhaas=# EXPLAIN (COSTS OFF)
579579 <listitem>
580580 <para>
581581 <literal>partially matched</literal> means that some but not all of the
582- specified advice targetes were observed during query planning.
582+ specified advice targets were observed during query planning.
583583 </para>
584584 </listitem>
585585
586586 <listitem>
587587 <para>
588588 <literal>not matched</literal> means that none of the
589589 specified advice targets were observed during query planning. This may
590- be happen if the advice simply doesn't match the query, or it may
590+ happen if the advice simply doesn't match the query, or it may
591591 occur if the relevant portion of the query was not planned, perhaps
592592 because it was gated by a condition that was simplified to constant false.
593593 </para>
@@ -829,11 +829,11 @@ rhaas=# EXPLAIN (COSTS OFF)
829829 <varname>pg_plan_advice.always_store_advice_details</varname> allows
830830 <literal>EXPLAIN</literal> to show details related to plan advice even
831831 when prepared queries are used. The default value is
832- <literal>false</literal>. When planning a prepared query, we do not
833- know whether <literal>EXPLAIN</literal> will be used, so by default, to
834- reduce overhead, we do not generate plan advice, and we do not generate
835- feedback on supplied advice. This means that if
836- <literal>EXPLAIN EXECUTE</literal> is later used on the prepared query,
832+ <literal>false</literal>. When planning a prepared query, it is not
833+ possible to know whether <literal>EXPLAIN</literal> will later be used,
834+ so by default, to reduce overhead, <literal>pg_plan_advice</literal>
835+ will not generate plan advice or feedback on supplied advice. This means
836+ that if <literal>EXPLAIN EXECUTE</literal> is used on the prepared query,
837837 it will not be able to show this information. Changing this setting to
838838 <literal>true</literal> avoids this problem, but adds additional
839839 overhead. It is probably a good idea to enable this option only in
0 commit comments