postgresql/src/backend/tcop
Robert Haas c6dbf1fe79 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 44339b892a 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
2016-06-06 14:52:58 -04:00
..
dest.c Stop the executor if no more tuples can be sent from worker to leader. 2016-06-06 14:52:58 -04:00
fastpath.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres.c Be more predictable about reporting "lock timeout" vs "statement timeout". 2016-05-27 10:40:20 -04:00
pquery.c Stop the executor if no more tuples can be sent from worker to leader. 2016-06-06 14:52:58 -04:00
utility.c Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00