- Notifications
You must be signed in to change notification settings - Fork28
Commit6c73b39
committed
Always build a custom plan node's targetlist from the path's pathtarget.
We were applying the use_physical_tlist optimization to all relationscan plans, even those implemented by custom scan providers. However,that's a bad idea for a couple of reasons. The custom provider mightbe 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 provideris 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 customprovider could make that decision for itself and insert a suitablepathtarget into the path, anyway.Per discussion with Dmitry Ivanov. Back-patch to 9.5 where custom scansupport was introduced. The argument that the custom provider can adjustthe behavior by changing the pathtarget only applies to 9.6+, but onbalance it seems more likely that use_physical_tlist will hurt customscans than help them.Discussion:https://postgr.es/m/e29ddd30-8ef9-4da5-a50b-2bb7b8c7198d@postgrespro.ru1 parent1ec36a9 commit6c73b39
1 file changed
+9
-0
lines changedLines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
761 | 761 |
| |
762 | 762 |
| |
763 | 763 |
| |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
764 | 773 |
| |
765 | 774 |
| |
766 | 775 |
| |
|
0 commit comments
Comments
(0)