pgsql: Support flattening of empty-FROM subqueries and one-row VALUES t

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Support flattening of empty-FROM subqueries and one-row VALUES t
Date: 2015-03-12 03:18:09
Message-ID: E1YVtdR-0007CX-08@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2015-03-12 10:13:36 Re: pgsql: Add GUC to enable compression of full page images stored in WAL.
Previous Message Tom Lane 2015-03-12 02:53:37 pgsql: Fix old bug in get_loop_count().