]> granicus.if.org Git - postgresql/commit
Support flattening of empty-FROM subqueries and one-row VALUES tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Mar 2015 03:18:03 +0000 (23:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Mar 2015 03:18:03 +0000 (23:18 -0400)
commitf4abd0241de20d5d6a79b84992b9e88603d44134
tree7b43a57a988932798cebdf16375f4aab860c52c0
parentb746d0c32d4fe749c8d39ccb09d8f0fb38bcc197
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.
src/backend/nodes/outfuncs.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepjointree.c
src/include/nodes/relation.h
src/include/optimizer/prep.h
src/test/regress/expected/join.out
src/test/regress/expected/rangefuncs.out
src/test/regress/sql/join.sql
src/test/regress/sql/rangefuncs.sql