postgresql/src/backend
Tom Lane 6c73b390b4 Always build a custom plan node's targetlist from the path's pathtarget.
We were applying the use_physical_tlist optimization to all relation
scan plans, even those implemented by custom scan providers.  However,
that's a bad idea for a couple of reasons.  The custom provider might
be unable to provide columns that it hadn't expected to be asked for
(for example, the custom scan might depend on an index-only scan).
Even more to the point, there's no good reason to suppose that this
"optimization" is a win for a custom scan; whatever the custom provider
is doing is likely not based on simply returning physical heap tuples.
(As a counterexample, if the custom scan is an interface to a column store,
demanding all columns would be a huge loss.)  If it is a win, the custom
provider could make that decision for itself and insert a suitable
pathtarget into the path, anyway.

Per discussion with Dmitry Ivanov.  Back-patch to 9.5 where custom scan
support was introduced.  The argument that the custom provider can adjust
the behavior by changing the pathtarget only applies to 9.6+, but on
balance it seems more likely that use_physical_tlist will hurt custom
scans than help them.

Discussion: https://postgr.es/m/e29ddd30-8ef9-4da5-a50b-2bb7b8c7198d@postgrespro.ru
2017-04-17 15:29:00 -04:00
..
access Avoid passing function pointers across process boundaries. 2017-04-15 16:23:27 -04:00
bootstrap Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
catalog Fix compiler warning 2017-04-16 20:49:40 -04:00
commands Avoid having vacuum set reltuples to 0 on non-empty relations in the 2017-03-16 22:31:49 +00:00
executor Avoid passing function pointers across process boundaries. 2017-04-15 16:23:27 -04:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Revert "Permit dump/reload of not-too-large >1GB tuples" 2016-12-06 12:46:03 -03:00
libpq Fix unportable disregard of alignment requirements in RADIUS code. 2017-03-26 17:35:35 -04:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Fix parallel query so it doesn't spoil row estimates above Gather. 2017-03-31 21:10:30 -04:00
optimizer Always build a custom plan node's targetlist from the path's pathtarget. 2017-04-17 15:29:00 -04:00
parser Fix YA unwanted behavioral difference with operator_precedence_warning. 2017-02-15 14:44:00 -05:00
po Translation updates 2017-02-06 12:42:47 -05:00
port Provide a way to control SysV shmem attach address in EXEC_BACKEND builds. 2017-04-15 17:27:51 -04:00
postmaster Avoid passing function pointers across process boundaries. 2017-04-15 16:23:27 -04:00
regex Fix regexport.c to behave sanely with lookaround constraints. 2017-04-13 17:18:35 -04:00
replication Spelling fixes 2017-03-14 13:45:54 -04:00
rewrite pgindent run for 9.6 2016-06-09 18:02:36 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Revert unintentional change in increasing usage count during pin of buffers, 2017-03-20 18:49:41 +03:00
tcop Remove dead code and fix comments in fast-path function handling. 2017-04-06 09:11:11 +03:00
tsearch Fix typos in comments. 2017-02-06 11:34:15 +02:00
utils Fix integer-overflow problems in interval comparison. 2017-04-05 23:51:28 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
nls.mk Translation updates 2017-02-06 12:42:47 -05:00