diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-12-05 17:28:39 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-12-05 17:28:39 -0500 |
commit | ab72716778128fb63d54ac256adf7fe6820a1185 (patch) | |
tree | 499c03ee0689719307ae780a4b66d49314ac2f41 /src/include/optimizer/pathnode.h | |
parent | 8097d189ccc2cd55a8bf189bd21cb196e3cfc385 (diff) | |
download | postgresql-ab72716778128fb63d54ac256adf7fe6820a1185.tar.gz postgresql-ab72716778128fb63d54ac256adf7fe6820a1185.zip |
Support Parallel Append plan nodes.
When we create an Append node, we can spread out the workers over the
subplans instead of piling on to each subplan one at a time, which
should typically be a bit more efficient, both because the startup
cost of any plan executed entirely by one worker is paid only once and
also because of reduced contention. We can also construct Append
plans using a mix of partial and non-partial subplans, which may allow
for parallelism in places that otherwise couldn't support it.
Unfortunately, this patch doesn't handle the important case of
parallelizing UNION ALL by running each branch in a separate worker;
the executor infrastructure is added here, but more planner work is
needed.
Amit Khandekar, Robert Haas, Amul Sul, reviewed and tested by
Ashutosh Bapat, Amit Langote, Rafia Sabih, Amit Kapila, and
Rajkumar Raghuwanshi.
Discussion: http://postgr.es/m/CAJ3gD9dy0K_E8r727heqXoBmWZ83HwLFwdcaSSmBQ1+S+vRuUQ@mail.gmail.com
Diffstat (limited to 'src/include/optimizer/pathnode.h')
-rw-r--r-- | src/include/optimizer/pathnode.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index e9ed16ad321..99f65b44f22 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.h @@ -14,6 +14,7 @@ #ifndef PATHNODE_H #define PATHNODE_H +#include "nodes/bitmapset.h" #include "nodes/relation.h" @@ -63,9 +64,11 @@ extern BitmapOrPath *create_bitmap_or_path(PlannerInfo *root, List *bitmapquals); extern TidPath *create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals, Relids required_outer); -extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths, - Relids required_outer, int parallel_workers, - List *partitioned_rels); +extern AppendPath *create_append_path(RelOptInfo *rel, + List *subpaths, List *partial_subpaths, + Relids required_outer, + int parallel_workers, bool parallel_aware, + List *partitioned_rels, double rows); extern MergeAppendPath *create_merge_append_path(PlannerInfo *root, RelOptInfo *rel, List *subpaths, |