]> granicus.if.org Git - postgresql/commit
Speed up planner's scanning for parallel-query hazards.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 19 Aug 2016 18:03:07 +0000 (14:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 19 Aug 2016 18:03:13 +0000 (14:03 -0400)
commitda1c91631e3577ea5818f855ebb5bd206d559006
tree90bdd7e1f5929851e2cb948cd08db891c0a24479
parent6f79ae7fe549bed8bbd1f54ddd9b98f8f9a315f5
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>
src/backend/nodes/outfuncs.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/plan/planmain.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/relnode.c
src/include/nodes/relation.h
src/include/optimizer/clauses.h