pgsql: Avoid projecting tuples unnecessarily in Gather and Gather Merge

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid projecting tuples unnecessarily in Gather and Gather Merge
Date: 2017-11-25 15:55:11
Message-ID: E1eIcnP-0002X3-E4@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid projecting tuples unnecessarily in Gather and Gather Merge.

It's most often the case that the target list for the Gather (Merge)
node matches the target list supplied by the underlying plan node;
when this is so, we can avoid the overhead of projecting.

This depends on commit f455e1125e2588d4cd4fc663c6a10da4e003a3b5 for
proper functioning.

Idea by Andres Freund. Patch by me. Review by Amit Kapila.

Discussion: http://postgr.es/m/CA+TgmoZ0ZL=cesZFq8c9NnfK6bqy-wwUd3_74iYGodYrSoQ7Fw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b10967eddf964f8c0a11060cf3f366bbdd1235f6

Modified Files
--------------
src/backend/executor/execScan.c | 75 ++-----------------------------
src/backend/executor/execUtils.c | 80 ++++++++++++++++++++++++++++++++++
src/backend/executor/nodeGather.c | 16 ++++---
src/backend/executor/nodeGatherMerge.c | 24 +++++-----
src/include/executor/executor.h | 2 +
5 files changed, 110 insertions(+), 87 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-11-25 16:48:16 pgsql: Improve planner's handling of set-returning functions in groupin
Previous Message Tom Lane 2017-11-25 05:18:25 Re: pgsql: Generational memory allocator