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: Stop the executor if no more tuples can be sent from worker to l
Date: Mon, 06 Jun 2016 19:16:37 +0000
Message-ID: <E1bA00r-0003mN-EE@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Stop the executor if no more tuples can be sent from worker to leader.

If a Gather node has read as many tuples as it needs (for example, due
to Limit) it may detach the queue connecting it to the worker before
reading all of the worker's tuples.  Rather than let the worker
continue to generate and send all of the results, have it stop after
sending the next tuple.

More could be done here to stop the worker even quicker, but this is
about as well as we can hope to do for 9.6.

This is in response to a problem report from Andreas Seltenreich.
Commit 44339b892a04e94bbb472235882dc6f7023bdc65 should be actually be
sufficient to fix that example even without this change, but it seems
better to do this, too, since we might otherwise waste quite a large
amount of effort in one or more workers.

Discussion: CAA4eK1KOKGqmz9bGu+Z42qhRwMbm4R5rfnqsLCNqFs9j14jzEA@mail.gmail.com

Amit Kapila

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c6dbf1fe79287291bc260cbc06b0de419d2a198c

Modified Files
--------------
src/backend/access/common/printtup.c  | 22 +++++++++++++++-------
src/backend/commands/copy.c           |  4 +++-
src/backend/commands/createas.c       |  6 ++++--
src/backend/commands/matview.c        |  6 ++++--
src/backend/executor/execMain.c       | 10 +++++++++-
src/backend/executor/execTuples.c     |  2 +-
src/backend/executor/functions.c      |  6 ++++--
src/backend/executor/spi.c            |  4 +++-
src/backend/executor/tqueue.c         | 14 ++++++++++++--
src/backend/executor/tstoreReceiver.c | 12 ++++++++----
src/backend/tcop/dest.c               |  3 ++-
src/backend/tcop/pquery.c             |  8 +++++++-
src/include/access/printtup.h         |  4 ++--
src/include/tcop/dest.h               |  6 ++++--
14 files changed, 78 insertions(+), 29 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: <E1bA00r-0003mN-EE@gemulon.postgresql.org>
Permalink:  ../E1bA00r-0003mN-EE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bA00r-0003mN-EE@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: Stop the executor if no more tuples can be sent from worker to l
  In-Reply-To: <E1bA00r-0003mN-EE@gemulon.postgresql.org>
  References: <E1bA00r-0003mN-EE@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