postgresql/src/backend
Tom Lane 9ff79b9d4e Fix up planner infrastructure to support LATERAL properly.
This patch takes care of a number of problems having to do with failure
to choose valid join orders and incorrect handling of lateral references
pulled up from subqueries.  Notable changes:

* Add a LateralJoinInfo data structure similar to SpecialJoinInfo, to
represent join ordering constraints created by lateral references.
(I first considered extending the SpecialJoinInfo structure, but the
semantics are different enough that a separate data structure seems
better.)  Extend join_is_legal() and related functions to prevent trying
to form unworkable joins, and to ensure that we will consider joins that
satisfy lateral references even if the joins would be clauseless.

* Fill in the infrastructure needed for the last few types of relation scan
paths to support parameterization.  We'd have wanted this eventually
anyway, but it is necessary now because a relation that gets pulled up out
of a UNION ALL subquery may acquire a reltargetlist containing lateral
references, meaning that its paths *have* to be parameterized whether or
not we have any code that can push join quals down into the scan.

* Compute data about lateral references early in query_planner(), and save
in RelOptInfo nodes, to avoid repetitive calculations later.

* Assorted corner-case bug fixes.

There's probably still some bugs left, but this is a lot closer to being
real than it was before.
2012-08-26 22:50:23 -04:00
..
access Avoid somewhat-theoretical overflow risks in RecordIsValid(). 2012-08-21 18:41:52 -04:00
bootstrap Fix management of pendingOpsTable in auxiliary processes. 2012-07-18 15:28:10 -04:00
catalog Make use of LATERAL in information_schema.sequences view. 2012-08-18 16:14:57 -04:00
commands Fix issues with checks for unsupported transaction states in Hot Standby. 2012-08-24 13:09:04 -04:00
executor Fix rescan logic in nodeCtescan. 2012-08-15 19:02:33 -04:00
foreign Add GetForeignColumnOptions() to foreign.c, and add some documentation. 2012-03-07 18:20:58 -05:00
lib Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
libpq Support having multiple Unix-domain sockets per postmaster. 2012-08-10 17:27:15 -04:00
main Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
nodes Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
optimizer Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
parser Allow OLD and NEW in multi-row VALUES within rules. 2012-08-19 14:12:16 -04:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Remove misleading hints about reducing the System V request size. 2012-07-03 10:07:47 -04:00
postmaster Remove external PID file on postmaster exit 2012-08-20 23:47:11 -04:00
regex Prevent corner-case core dump in rfree(). 2012-07-15 13:27:54 -04:00
replication Turn off WalSender keepalives by default, users can enable if desired 2012-08-09 17:07:03 +01:00
rewrite Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
snowball Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
storage Fix issues with checks for unsupported transaction states in Hot Standby. 2012-08-24 13:09:04 -04:00
tcop Support having multiple Unix-domain sockets per postmaster. 2012-08-10 17:27:15 -04:00
tsearch Make new event trigger facility actually do something. 2012-07-20 11:39:01 -04:00
utils Allow text timezone designations, e.g. "America/Chicago", when using the 2012-08-25 17:44:53 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile Fix incorrect make maintainer-clean rule. 2012-04-07 18:16:50 -04:00
nls.mk Sort file list when creating gettext-files 2011-12-27 20:20:56 +02:00