pgsql: Mark finished Plan nodes with parallel_safe flags.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Mark finished Plan nodes with parallel_safe flags.
Date: 2017-04-12 19:13:43
Message-ID: E1cyNi3-0002zT-Tz@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/003d80f3dfadd57c6aac8480436ff53ee2c978bd

Modified Files
--------------
src/backend/nodes/copyfuncs.c | 1 +
src/backend/nodes/outfuncs.c | 1 +
src/backend/nodes/readfuncs.c | 1 +
src/backend/optimizer/plan/createplan.c | 31 +++++++++++++++++++++++++------
src/backend/optimizer/plan/planner.c | 7 +++----
src/backend/optimizer/plan/subselect.c | 15 +++++++--------
src/include/nodes/plannodes.h | 1 +
7 files changed, 39 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2017-04-12 19:40:39 pgsql: git_changelog: improve instructions for finding branch commits
Previous Message Peter Eisentraut 2017-04-12 18:47:08 pgsql: Remove some tabs in SQL code in C string literals