forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commitae3699a
committed
Teach reparameterize_path() to handle AppendPaths.
If we're inside a lateral subquery, there may be no unparameterized pathsfor a particular child relation of an appendrel, in which case we *must*be able to create similarly-parameterized paths for each other childrelation, else the planner will fail with "could not devise a query planfor the given query". This means that there are situations where we'dbetter be able to reparameterize at least one path for each child.This calls into question the assumption in reparameterize_path() thatit can just punt if it feels like it. However, the only case that isknown broken right now is where the child is itself an appendrel so thatall its paths are AppendPaths. (I think possibly I disregarded that inthe original coding on the theory that nested appendrels would get foldedtogether --- but that only happens *after* reparameterize_path(), so it'snot excused from handling a child AppendPath.) Given that this code's beenlike this since 9.3 when LATERAL was introduced, it seems likely we'd haveheard of other cases by now if there were a larger problem.Per report from Elvis Pranskevichus. Back-patch to 9.3.Discussion:https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net1 parent2843c01 commitae3699a
File tree
3 files changed
+52
-0
lines changed- src
- backend/optimizer/util
- test/regress
- expected
- sql
3 files changed
+52
-0
lines changedLines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3205 | 3205 |
| |
3206 | 3206 |
| |
3207 | 3207 |
| |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
3208 | 3231 |
| |
3209 | 3232 |
| |
3210 | 3233 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5150 | 5150 |
| |
5151 | 5151 |
| |
5152 | 5152 |
| |
| 5153 | + | |
| 5154 | + | |
| 5155 | + | |
| 5156 | + | |
| 5157 | + | |
| 5158 | + | |
| 5159 | + | |
| 5160 | + | |
| 5161 | + | |
| 5162 | + | |
| 5163 | + | |
| 5164 | + | |
| 5165 | + | |
| 5166 | + | |
| 5167 | + | |
| 5168 | + | |
| 5169 | + | |
| 5170 | + | |
| 5171 | + | |
5153 | 5172 |
| |
5154 | 5173 |
| |
5155 | 5174 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1666 | 1666 |
| |
1667 | 1667 |
| |
1668 | 1668 |
| |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1669 | 1679 |
| |
1670 | 1680 |
| |
1671 | 1681 |
| |
|
0 commit comments
Comments
(0)