Skip site navigation (1) Skip section navigation (2)

pgsql: Improve make_subplanTargetList to avoid including Varsunnecessa

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve make_subplanTargetList to avoid including Varsunnecessa
Date: 2011-07-16 20:47:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Improve make_subplanTargetList to avoid including Vars unnecessarily.

If a Var was used only in a GROUP BY expression, the previous
implementation would include the Var by itself (as well as the expression)
in the generated targetlist.  This wouldn't affect the efficiency of the
scan/join part of the plan at all, but it could result in passing
unnecessarily-wide rows through sorting and grouping steps.  It turns out
to take only a little more code, and not noticeably more time, to generate
a tlist without such redundancy, so let's do that.  Per a recent gripe from
HarmeekSingh Bedi.



Modified Files
src/backend/optimizer/plan/planner.c |  162 +++++++++++++++++++++++-----------
1 files changed, 110 insertions(+), 52 deletions(-)

pgsql-committers by date

Next:From: Jim NasbyDate: 2011-07-17 17:20:25
Subject: Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
Previous:From: Tom LaneDate: 2011-07-16 18:23:38
Subject: pgsql: Replace errdetail("%s", ...) with errdetail_internal("%s",...).

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group