pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Generate parallel sequential scan plans in simple cases.
Date: Wed, 11 Nov 2015 14:03:05 +0000
Message-ID: <E1ZwVzN-0000Xz-5e@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Generate parallel sequential scan plans in simple cases.

Add a new flag, consider_parallel, to each RelOptInfo, indicating
whether a plan for that relation could conceivably be run inside of
a parallel worker.  Right now, we're pretty conservative: for example,
it might be possible to defer applying a parallel-restricted qual
in a worker, and later do it in the leader, but right now we just
don't try to parallelize access to that relation.  That's probably
the right decision in most cases, anyway.

Using the new flag, generate parallel sequential scan plans for plain
baserels, meaning that we now have parallel sequential scan in
PostgreSQL.  The logic here is pretty unsophisticated right now: the
costing model probably isn't right in detail, and we can't push joins
beneath Gather nodes, so the number of plans that can actually benefit
from this is pretty limited right now.  Lots more work is needed.
Nevertheless, it seems time to enable this functionality so that all
this code can actually be tested easily by users and developers.

Note that, if you wish to test this functionality, it will be
necessary to set max_parallel_degree to a value greater than the
default of 0.  Once a few more loose ends have been tidied up here, we
might want to consider changing the default value of this GUC, but
I'm leaving it alone for now.

Along the way, fix a bug in cost_gather: the previous coding thought
that a Gather node's transfer overhead should be costed on the basis of
the relation size rather than the number of tuples that actually need
to be passed off to the leader.

Patch by me, reviewed in earlier versions by Amit Kapila.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/80558c1f5aa109d08db0fbd76a6d370f900628a8

Modified Files
--------------
src/backend/nodes/outfuncs.c          |    1 +
src/backend/optimizer/path/allpaths.c |  190 ++++++++++++++++++++++++++++++++-
src/backend/optimizer/path/costsize.c |    2 +-
src/backend/optimizer/plan/planmain.c |   12 +++
src/backend/optimizer/plan/planner.c  |    9 +-
src/backend/optimizer/util/clauses.c  |  183 +++++++++++++++++++++++++------
src/backend/optimizer/util/relnode.c  |   21 ++++
src/backend/utils/cache/lsyscache.c   |   22 ++++
src/include/nodes/relation.h          |    1 +
src/include/optimizer/clauses.h       |    2 +-
src/include/utils/lsyscache.h         |    1 +
11 files changed, 400 insertions(+), 44 deletions(-)


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


view thread (10+ messages)  latest in thread

Message-ID: <E1ZwVzN-0000Xz-5e@gemulon.postgresql.org>
Permalink:  ../E1ZwVzN-0000Xz-5e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ZwVzN-0000Xz-5e@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: rhaas@postgresql.org
  Subject: Re: pgsql: Generate parallel sequential scan plans in simple cases.
  In-Reply-To: <E1ZwVzN-0000Xz-5e@gemulon.postgresql.org>
  References: <E1ZwVzN-0000Xz-5e@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