diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-02-07 11:39:22 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-02-07 11:41:33 -0500 |
commit | 7c944bd903392829608a9fba5b0e68c4fe89abf8 (patch) | |
tree | 258a592bf8ddb522d3522415ad76b0dfa0f8d250 /src/include/optimizer/planmain.h | |
parent | a1c1af2a1f6099c039f145c1edb52257f315be51 (diff) |
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. When force_parallel_mode = regress, make additional
changes to allow the regression tests to run cleanly even though parallel
workers have been injected under the hood.
Taken together, this facilitates both better user testing and better
regression testing of the parallelism code.
Robert Haas, with help from Amit Kapila and Rushabh Lathia.
Diffstat (limited to 'src/include/optimizer/planmain.h')
-rw-r--r-- | src/include/optimizer/planmain.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h index 7ae73676e8e..eaa642bc57e 100644 --- a/src/include/optimizer/planmain.h +++ b/src/include/optimizer/planmain.h @@ -17,9 +17,18 @@ #include "nodes/plannodes.h" #include "nodes/relation.h" +/* possible values for force_parallel_mode */ +typedef enum +{ + FORCE_PARALLEL_OFF, + FORCE_PARALLEL_ON, + FORCE_PARALLEL_REGRESS +} ForceParallelMode; + /* GUC parameters */ #define DEFAULT_CURSOR_TUPLE_FRACTION 0.1 extern double cursor_tuple_fraction; +extern int force_parallel_mode; /* query_planner callback to compute query_pathkeys */ typedef void (*query_pathkeys_callback) (PlannerInfo *root, void *extra); |