From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Improve handling of group-column indexes in GroupingSetsPath.
Date: Wed, 09 Mar 2016 03:32:20 +0000
Message-ID: <E1adUrE-0003pF-SG@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Improve handling of group-column indexes in GroupingSetsPath.
Instead of having planner.c compute a groupColIdx array and store it in
GroupingSetsPaths, make create_groupingsets_plan() find the grouping
columns by searching in the child plan node's tlist. Although that's
probably a bit slower for create_groupingsets_plan(), it's more like
the way every other plan node type does this, and it provides positive
confirmation that we know which child output columns we're supposed to be
grouping on. (Indeed, looking at this now, I'm not at all sure that it
wasn't broken before, because create_groupingsets_plan() isn't demanding
an exact tlist match from its child node.) Also, this allows substantial
simplification in planner.c, because it no longer needs to compute the
groupColIdx array at all; no other cases were using it.
I'd intended to put off this refactoring until later (like 9.7), but
in view of the likely bug fix and the need to rationalize planner.c's
tlist handling so we can do something sane with Konstantin Knizhnik's
function-evaluation-postponement patch, I think it can't wait.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/9e8b99420fe5f80495ada8dc50aeb7b954b33093
Modified Files
--------------
src/backend/nodes/outfuncs.c | 1 -
src/backend/optimizer/plan/createplan.c | 12 +--
src/backend/optimizer/plan/planner.c | 130 +++++++-------------------------
src/backend/optimizer/util/pathnode.c | 5 +-
src/backend/optimizer/util/tlist.c | 20 +++++
src/include/nodes/relation.h | 1 -
src/include/optimizer/pathnode.h | 1 -
src/include/optimizer/tlist.h | 2 +
8 files changed, 57 insertions(+), 115 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve handling of group-column indexes in GroupingSetsPath.
In-Reply-To: <E1adUrE-0003pF-SG@gemulon.postgresql.org>
References: <E1adUrE-0003pF-SG@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