]> granicus.if.org Git - postgresql/commit
Push tuple limits through Gather and Gather Merge.
authorRobert Haas <rhaas@postgresql.org>
Tue, 29 Aug 2017 17:12:23 +0000 (13:12 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 29 Aug 2017 17:16:55 +0000 (13:16 -0400)
commit3452dc5240da43e833118484e1e9b4894d04431c
treed158d5d9630d80bc8a5ca838ba76eede60c77ba9
parentce5dcf54b942a469194ae390730f803b3f3fb928
Push tuple limits through Gather and Gather Merge.

If we only need, say, 10 tuples in total, then we certainly don't need
more than 10 tuples from any single process.  Pushing down the limit
lets workers exit early when possible.  For Gather Merge, there is
an additional benefit: a Sort immediately below the Gather Merge can
be done as a bounded sort if there is an applicable limit.

Robert Haas and Tom Lane

Discussion: http://postgr.es/m/CA+TgmoYa3QKKrLj5rX7UvGqhH73G1Li4B-EKxrmASaca2tFu9Q@mail.gmail.com
src/backend/executor/execParallel.c
src/backend/executor/execProcnode.c
src/backend/executor/nodeGather.c
src/backend/executor/nodeGatherMerge.c
src/backend/executor/nodeLimit.c
src/include/executor/execParallel.h
src/include/executor/executor.h
src/include/nodes/execnodes.h
src/test/regress/expected/select_parallel.out
src/test/regress/sql/select_parallel.sql