pg_plan_advice: Fix multiple problems with NO_GATHER advice.

First, the documentation describes NO_GATHER in a way that suggests
that it should both suppress partial path generation and also prohibit
the placement of Gather and Gather Merge within a join problem, but in
fact it only did the latter. Change it to do the former as well. Like
commit f71a9969d58e3e70239fc51bbeae668db973b265, this is fallout from
my failure to realize everything that needed to be changed when I
abandoned the idea of clearing consider_parallel as a way to suppress
parallel paths.

Second, emit NO_GATHER advice for the non-partial children of a
Parallel Append, because we want exactly the behaviors described
above for that case. In order to reproduce the Parallel Append, we'll
need an entirely non-parallel path for that child.

Third, update the documentation to be more precise about what happens
when NO_GATHER is applied to a child table. I believe I intended this
to work in the way described in the first paragraph above, but because
of the omission noted there, it had no effect at all. Moreover, the
documentation described the two different effects of NO_GATHER as if
subqueries were the only relevant case, but partitioning or table
inheritance gives rise to similar effects, so clarify accordingly.

Discussion: 
http://postgr.es/m/CA+Tgmob3X+_CSjAa_BtU9bXrX_ge_HyvO=7gscltbpncgwn...@mail.gmail.com
Tested-by: Jakub Wartak <[email protected]>
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3269ccc961189572ebd8cff4742461ed0d172105

Modified Files
--------------
contrib/pg_plan_advice/expected/gather.out | 129 +++++++++++++++++++++++++++++
contrib/pg_plan_advice/pgpa_planner.c      | 101 ++++++++++++++++++++++
contrib/pg_plan_advice/pgpa_walker.c       |  20 ++++-
contrib/pg_plan_advice/sql/gather.sql      |  37 +++++++++
doc/src/sgml/pgplanadvice.sgml             |  13 ++-
src/tools/pgindent/typedefs.list           |   1 +
6 files changed, 297 insertions(+), 4 deletions(-)

Reply via email to