Introduce a new GUC force_parallel_mode for testing purposes.
authorRobert Haas <[email protected]>
Wed, 30 Sep 2015 22:35:40 +0000 (18:35 -0400)
committerRobert Haas <[email protected]>
Mon, 1 Feb 2016 21:07:32 +0000 (16:07 -0500)
commit1b4d0cffd00248df5c1c57239284e985ba82cf86
tree50801a54f01aff475e3c4f820a300b813e02390c
parentc52d778b4f65c76f7554e78ce336d970879d2198
Introduce a new GUC force_parallel_mode for testing purposes.

When force_parallel_mode = true, we enable the parallel mode restrictions
for all queries for which this is believed to be safe.  For the subset of
those queries believed to be safe to run entirely within a worker, we spin
up a worker and run the query there instead of running it in the
original process.

XXX: This patch still needs some work yet as far as explain.c is
concerned.  Instead of what happens here at present, we should have a
new Boolean inside the Gather node, maybe "bool invisible".  explain.c
should look through invisible Gather nodes but not others;
force_parallel_mode should create an invisible Gather node rather than
a normal one.  No effect at execution time.

XXX: I think force_parallel_mode should have three modes: on, off,
regress.  When off, we act normally.  When on, we push regular, visible
Gather nodes on top of plans that can support them, and display error
context as usual.  The third mode, regress, turns the Gather nodes
invisible and suppresses the additional error context.
doc/src/sgml/config.sgml
src/backend/access/transam/parallel.c
src/backend/commands/explain.c
src/backend/nodes/outfuncs.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/include/nodes/relation.h
src/include/optimizer/planmain.h