forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb3aaf90
committed
Rearrange planner to save the whole PlannerInfo (subroot) for a subquery.
Formerly, set_subquery_pathlist and other creators of plans for subqueriessaved only the rangetable and rowMarks lists from the lower-levelPlannerInfo. But there's no reason not to remember the whole PlannerInfo,and indeed this turns out to simplify matters in a number of places.The immediate reason for doing this was so that the subroot will still beaccessible when we're trying to extract column statistics out of analready-planned subquery. But now that I've done it, it seems like a goodcode-beautification effort in its own right.I also chose to get rid of the transient subrtable and subrowmark fields inSubqueryScan nodes, in favor of having setrefs.c look up the subquery'sRelOptInfo. That required changing all the APIs in setrefs.c to passPlannerInfo not PlannerGlobal, which was a large but quite mechanicaltransformation.One side-effect not foreseen at the beginning is that this finally brokeinheritance_planner's assumption that replanning the same subquery RTE Ntimes would necessarily give interchangeable results each time. Thatassumption was always pretty risky, but now we really have to make aseparate RTE for each instance so that there's a place to carry theseparate subroots.1 parent42ad992 commitb3aaf90
File tree
19 files changed
+394
-304
lines changed- src
- backend
- executor
- nodes
- optimizer
- path
- plan
- prep
- util
- rewrite
- include
- nodes
- optimizer
19 files changed
+394
-304
lines changedLines changed: 1 addition & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
| 102 | + | |
106 | 103 |
| |
107 | 104 |
| |
108 |
| - | |
109 |
| - | |
110 | 105 |
| |
111 | 106 |
| |
112 | 107 |
| |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
456 | 456 |
| |
457 | 457 |
| |
458 | 458 |
| |
459 |
| - | |
460 |
| - | |
461 | 459 |
| |
462 | 460 |
| |
463 | 461 |
| |
|
Lines changed: 2 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
489 | 489 |
| |
490 | 490 |
| |
491 | 491 |
| |
492 |
| - | |
493 |
| - | |
494 | 492 |
| |
495 | 493 |
| |
496 | 494 |
| |
| |||
1656 | 1654 |
| |
1657 | 1655 |
| |
1658 | 1656 |
| |
1659 |
| - | |
1660 |
| - | |
| 1657 | + | |
1661 | 1658 |
| |
1662 | 1659 |
| |
1663 | 1660 |
| |
| |||
1734 | 1731 |
| |
1735 | 1732 |
| |
1736 | 1733 |
| |
1737 |
| - | |
1738 |
| - | |
| 1734 | + | |
1739 | 1735 |
| |
1740 | 1736 |
| |
1741 | 1737 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
791 | 791 |
| |
792 | 792 |
| |
793 | 793 |
| |
794 |
| - | |
795 |
| - | |
| 794 | + | |
796 | 795 |
| |
797 | 796 |
| |
798 |
| - | |
| 797 | + | |
799 | 798 |
| |
800 | 799 |
| |
801 | 800 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3221 | 3221 |
| |
3222 | 3222 |
| |
3223 | 3223 |
| |
3224 |
| - | |
3225 |
| - | |
| 3224 | + | |
3226 | 3225 |
| |
| 3226 | + | |
3227 | 3227 |
| |
3228 | 3228 |
| |
3229 | 3229 |
| |
|
Lines changed: 2 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1557 | 1557 |
| |
1558 | 1558 |
| |
1559 | 1559 |
| |
1560 |
| - | |
1561 |
| - | |
1562 |
| - | |
| 1560 | + | |
1563 | 1561 |
| |
1564 | 1562 |
| |
1565 | 1563 |
| |
| |||
2931 | 2929 |
| |
2932 | 2930 |
| |
2933 | 2931 |
| |
2934 |
| - | |
2935 |
| - | |
2936 |
| - | |
| 2932 | + | |
2937 | 2933 |
| |
2938 | 2934 |
| |
2939 | 2935 |
| |
| |||
2952 | 2948 |
| |
2953 | 2949 |
| |
2954 | 2950 |
| |
2955 |
| - | |
2956 |
| - | |
2957 | 2951 |
| |
2958 | 2952 |
| |
2959 | 2953 |
| |
|
Lines changed: 4 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
102 | 101 |
| |
103 | 102 |
| |
104 | 103 |
| |
| |||
128 | 127 |
| |
129 | 128 |
| |
130 | 129 |
| |
131 |
| - | |
132 |
| - | |
| 130 | + | |
133 | 131 |
| |
134 | 132 |
| |
135 | 133 |
| |
136 | 134 |
| |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 | 135 |
| |
141 | 136 |
| |
142 | 137 |
| |
| |||
151 | 146 |
| |
152 | 147 |
| |
153 | 148 |
| |
154 |
| - | |
| 149 | + | |
| 150 | + | |
155 | 151 |
| |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
| 152 | + | |
165 | 153 |
| |
166 | 154 |
| |
167 | 155 |
| |
|
0 commit comments
Comments
(0)