]> granicus.if.org Git - postgresql/commit
Fix a couple of oversights associated with the "physical tlist" optimization:
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Apr 2008 21:22:14 +0000 (21:22 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Apr 2008 21:22:14 +0000 (21:22 +0000)
commit25e46a504b215fb7e11463d628d3477098323367
tree7f552ba1609b90cf2f254fa8d62ac4d51df546d8
parentc5c7ba1b103847439949762d6fdeec4144b9ceed
Fix a couple of oversights associated with the "physical tlist" optimization:
we had several code paths where a physical tlist could be used for the input
to a Sort node, which is a dumb idea because any unneeded table columns will
increase the volume of data the sort has to push around.

(Unfortunately the easy-looking fix of calling disuse_physical_tlist during
make_sort_xxx doesn't work because in most cases we're already committed to
the current input tlist --- it's been marked with sort column numbers, or
we've built grouping column numbers using it, etc.  The tlist has to be
selected properly at the calling level before we start constructing sort-col
information.  This is easy enough to do, we were just failing to take the
point into consideration.)

Back-patch to 8.3.  I believe the problem probably exists clear back to 7.4
when the physical tlist optimization was added, but I'm afraid to back-patch
further than 8.3 without a great deal more study than I want to put into it.
The code in this area has drifted a lot over time.  The real-world importance
of these code paths is uncertain anyway --- I think in many cases we'd
probably prefer hash-based methods.
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/include/optimizer/planmain.h