- Notifications
You must be signed in to change notification settings - Fork5
Commitaeb9ae6
committed
Disable physical tlist if any Var would need multiple sortgroupref labels.
As part of upper planner pathification (commit3fc6e2d) I redidcreateplan.c's approach to the physical-tlist optimization, in which scannodes are allowed to return exactly the underlying table's columns so asto save doing a projection step at runtime. The logic was intentionallymore aggressive than before about applying the optimization, which isgenerally a good thing, but Andres Freund found a case in which it gottoo aggressive. Namely, if any column is referenced more than once inthe parent plan node's sorting or grouping column list, we can't optimizebecause then that column would need to have more than one ressortgroupreflabel, and we only have space for one.Add logic to detect this situation in use_physical_tlist(), and also addsome error checking in apply_pathtarget_labeling_to_tlist(), which thisexample proves was being overly cavalier about whether what it was doingmade any sense.The added test case exposes the problem only because we do not eliminateduplicate grouping keys. That might be something to fix someday, but itdoesn't seem like appropriate post-beta work.Report: <20160526021235.w4nq7k3gnheg7vit@alap3.anarazel.de>1 parentd7ef357 commitaeb9ae6
File tree
4 files changed
+65
-8
lines changed- src
- backend/optimizer
- plan
- util
- test/regress
- expected
- sql
4 files changed
+65
-8
lines changedLines changed: 13 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
787 | 787 |
| |
788 | 788 |
| |
789 | 789 |
| |
790 |
| - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
791 | 793 |
| |
792 | 794 |
| |
793 | 795 |
| |
| 796 | + | |
| 797 | + | |
794 | 798 |
| |
795 | 799 |
| |
796 | 800 |
| |
| |||
799 | 803 |
| |
800 | 804 |
| |
801 | 805 |
| |
802 |
| - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
803 | 814 |
| |
804 | 815 |
| |
805 | 816 |
| |
|
Lines changed: 17 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
736 | 736 |
| |
737 | 737 |
| |
738 | 738 |
| |
739 |
| - | |
740 |
| - | |
741 |
| - | |
742 |
| - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
743 | 742 |
| |
744 | 743 |
| |
745 | 744 |
| |
746 | 745 |
| |
747 | 746 |
| |
748 |
| - | |
749 |
| - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
750 | 761 |
| |
751 | 762 |
| |
752 | 763 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
127 | 151 |
| |
128 | 152 |
| |
129 | 153 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
37 | 48 |
| |
38 | 49 |
| |
39 | 50 |
| |
|
0 commit comments
Comments
(0)