postgresql/src/backend
Tom Lane b3aaf9081a Rearrange planner to save the whole PlannerInfo (subroot) for a subquery.
Formerly, set_subquery_pathlist and other creators of plans for subqueries
saved only the rangetable and rowMarks lists from the lower-level
PlannerInfo.  But there's no reason not to remember the whole PlannerInfo,
and indeed this turns out to simplify matters in a number of places.

The immediate reason for doing this was so that the subroot will still be
accessible when we're trying to extract column statistics out of an
already-planned subquery.  But now that I've done it, it seems like a good
code-beautification effort in its own right.

I also chose to get rid of the transient subrtable and subrowmark fields in
SubqueryScan nodes, in favor of having setrefs.c look up the subquery's
RelOptInfo.  That required changing all the APIs in setrefs.c to pass
PlannerInfo not PlannerGlobal, which was a large but quite mechanical
transformation.

One side-effect not foreseen at the beginning is that this finally broke
inheritance_planner's assumption that replanning the same subquery RTE N
times would necessarily give interchangeable results each time.  That
assumption was always pretty risky, but now we really have to make a
separate RTE for each instance so that there's a place to carry the
separate subroots.
2011-09-03 15:36:24 -04:00
..
access Whitespace adjustment for consistency in the file 2011-09-03 01:28:05 +03:00
bootstrap Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
catalog Teach ANALYZE to clear pg_class.relhassubclass when appropriate. 2011-09-02 14:29:31 -04:00
commands Teach ANALYZE to clear pg_class.relhassubclass when appropriate. 2011-09-02 14:29:31 -04:00
executor Rearrange planner to save the whole PlannerInfo (subroot) for a subquery. 2011-09-03 15:36:24 -04:00
foreign Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Rearrange planner to save the whole PlannerInfo (subroot) for a subquery. 2011-09-03 15:36:24 -04:00
optimizer Rearrange planner to save the whole PlannerInfo (subroot) for a subquery. 2011-09-03 15:36:24 -04:00
parser Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
postmaster Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
regex Add markers for skips. 2011-08-26 18:15:13 -04:00
replication Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
rewrite Rearrange planner to save the whole PlannerInfo (subroot) for a subquery. 2011-09-03 15:36:24 -04:00
snowball Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
storage Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
tcop Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
tsearch Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
utils Add archive_command example 2011-09-03 01:29:09 +03:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Fix symlink for errcodes.h so it works in VPATH builds from tarballs. 2011-06-22 13:08:08 -04:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
nls.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00