pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Teach create_projection_plan to omit projection where possible.
Date: Thu, 29 Mar 2018 19:39:48 +0000
Message-ID: <E1f1dOm-0006WO-3f@gemulon.postgresql.org> (raw)

Teach create_projection_plan to omit projection where possible.

We sometimes insert a ProjectionPath into a plan tree when projection
is not strictly required. The existing code already arranges to avoid
emitting a Result node when the ProjectionPath's subpath can perform
the projection itself, but previously it didn't consider the
possibility that the parent node might not actually require the
projection to be performed at all.

Skipping projection when it's not required can not only avoid Result
nodes that aren't needed, but also avoid losing the "physical tlist"
optimization unneccessarily.

Patch by me, reviewed by Amit Kapila.

Discussion: http://postgr.es/m/CA+TgmoakT5gmahbPWGqrR2nAdFOMAOnOXYoWHRdVfGWs34t6_A@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/createplan.c | 98 +++++++++++++++++++++++++--------
1 file changed, 75 insertions(+), 23 deletions(-)



Message-ID: <E1f1dOm-0006WO-3f@gemulon.postgresql.org>
Permalink:  ../E1f1dOm-0006WO-3f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f1dOm-0006WO-3f@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: Teach create_projection_plan to omit projection where possible.
  In-Reply-To: <E1f1dOm-0006WO-3f@gemulon.postgresql.org>
  References: <E1f1dOm-0006WO-3f@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