pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Mark finished Plan nodes with parallel_safe flags.
Date: Wed, 12 Apr 2017 19:13:43 +0000
Message-ID: <E1cyNi3-0002zT-Tz@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1cyNi3-0002zT-Tz@gemulon.postgresql.org>
Permalink:  ../E1cyNi3-0002zT-Tz@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cyNi3-0002zT-Tz@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Mark finished Plan nodes with parallel_safe flags.
  In-Reply-To: <E1cyNi3-0002zT-Tz@gemulon.postgresql.org>
  References: <E1cyNi3-0002zT-Tz@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox