pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Always build a custom plan node's targetlist from the path's pat 3+ messages / 1 participants [nested] [flat]
* pgsql: Always build a custom plan node's targetlist from the path's pat @ 2017-04-17 19:29 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-04-17 19:29 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/76799fc89d2ca6f357c188daa4e1b38f0a59e360 Modified Files -------------- src/backend/optimizer/plan/createplan.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Always build a custom plan node's targetlist from the path's pat @ 2017-04-17 19:29 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-04-17 19:29 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_6_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/6c73b390b4797c6b81ee4f5d17feda34cfde6ccd Modified Files -------------- src/backend/optimizer/plan/createplan.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Always build a custom plan node's targetlist from the path's pat @ 2017-04-17 19:29 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-04-17 19:29 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/6f0f98bb0bced134c09b7acf8fe35ff3a6f1bbd2 Modified Files -------------- src/backend/optimizer/plan/createplan.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-04-17 19:29 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-04-17 19:29 pgsql: Always build a custom plan node's targetlist from the path's pat Tom Lane <tgl@sss.pgh.pa.us> 2017-04-17 19:29 pgsql: Always build a custom plan node's targetlist from the path's pat Tom Lane <tgl@sss.pgh.pa.us> 2017-04-17 19:29 pgsql: Always build a custom plan node's targetlist from the path's pat Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox