]> granicus.if.org Git - postgresql/commit
Mark finished Plan nodes with parallel_safe flags.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Apr 2017 19:13:23 +0000 (15:13 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Apr 2017 19:13:34 +0000 (15:13 -0400)
commit003d80f3dfadd57c6aac8480436ff53ee2c978bd
tree0d8c430e9f9a262eddf5f27e6f1963c95c85f6c1
parent35b5f7b608fa1ae12d07cd475c382c5f1341648d
Mark finished Plan nodes with parallel_safe flags.

We'd managed to avoid doing this so far, but it seems pretty obvious
that it would be forced on us some day, and this is much the cleanest
way of approaching the open problem that parallel-unsafe subplans are
being transmitted to parallel workers.  Anyway there's no space cost
due to alignment considerations, and the time cost is pretty minimal
since we're just copying the flag from the corresponding Path node.
(At least in most cases ... some of the klugier spots in createplan.c
have to work a bit harder.)

In principle we could perhaps get rid of SubPlan.parallel_safe,
but I thought it better to keep that in case there are reasons to
consider a SubPlan unsafe even when its child plan is parallel-safe.

This patch doesn't actually do anything with the new flags, but
I thought I'd commit it separately anyway.

Note: although this touches outfuncs/readfuncs, there's no need for
a catversion bump because Plan trees aren't stored on disk.

Discussion: https://postgr.es/m/87tw5x4vcu.fsf@credativ.de
src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/subselect.c
src/include/nodes/plannodes.h