summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane2016-08-19 18:03:07 +0000
committerTom Lane2016-08-19 18:03:13 +0000
commitda1c91631e3577ea5818f855ebb5bd206d559006 (patch)
tree90bdd7e1f5929851e2cb948cd08db891c0a24479 /src/include/optimizer
parent6f79ae7fe549bed8bbd1f54ddd9b98f8f9a315f5 (diff)
Speed up planner's scanning for parallel-query hazards.
We need to scan the whole parse tree for parallel-unsafe functions. If there are none, we'll later need to determine whether particular subtrees contain any parallel-restricted functions. The previous coding retained no knowledge from the first scan, even though this is very wasteful in the common case where the query contains only parallel-safe functions. We can bypass all of the later scans by remembering that fact. This provides a small but measurable speed improvement when the case applies, and shouldn't cost anything when it doesn't. Patch by me, reviewed by Robert Haas Discussion: <3740.1471538387@sss.pgh.pa.us>
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/clauses.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index be7c639f7b9..9abef37cb6b 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -61,7 +61,8 @@ extern bool contain_subplans(Node *clause);
extern bool contain_mutable_functions(Node *clause);
extern bool contain_volatile_functions(Node *clause);
extern bool contain_volatile_functions_not_nextval(Node *clause);
-extern bool has_parallel_hazard(Node *node, bool allow_restricted);
+extern char max_parallel_hazard(Query *parse);
+extern bool is_parallel_safe(PlannerInfo *root, Node *node);
extern bool contain_nonstrict_functions(Node *clause);
extern bool contain_leaked_vars(Node *clause);