From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Support flattening of empty-FROM subqueries and one-row VALUES t
Date: Thu, 12 Mar 2015 03:18:09 +0000
Message-ID: <E1YVtdR-0007CX-08@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Support flattening of empty-FROM subqueries and one-row VALUES tables.
We can't handle this in the general case due to limitations of the
planner's data representations; but we can allow it in many useful cases,
by being careful to flatten only when we are pulling a single-row subquery
up into a FROM (or, equivalently, inner JOIN) node that will still have at
least one remaining relation child. Per discussion of an example from
Kyotaro Horiguchi.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/f4abd0241de20d5d6a79b84992b9e88603d44134
Modified Files
--------------
src/backend/nodes/outfuncs.c | 1 +
src/backend/optimizer/plan/planner.c | 3 +-
src/backend/optimizer/prep/prepjointree.c | 452 +++++++++++++++++++++++++----
src/include/nodes/relation.h | 1 +
src/include/optimizer/prep.h | 2 +-
src/test/regress/expected/join.out | 28 +-
src/test/regress/expected/rangefuncs.out | 24 +-
src/test/regress/sql/join.sql | 13 +-
src/test/regress/sql/rangefuncs.sql | 13 +-
9 files changed, 466 insertions(+), 71 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: Support flattening of empty-FROM subqueries and one-row VALUES t
In-Reply-To: <E1YVtdR-0007CX-08@gemulon.postgresql.org>
References: <E1YVtdR-0007CX-08@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