- Notifications
You must be signed in to change notification settings - Fork5
Commit89db839
committed
Further adjustments to PlaceHolderVar removal.
A new test case from Andreas Seltenreich showed that we were still a bitconfused about removing PlaceHolderVars during join removal. Specifically,remove_rel_from_query would remove a PHV that was used only underneaththe removable join, even if the place where it's used was the join partnerrelation and not the join clause being deleted. This would lead to a"too late to create a new PlaceHolderInfo" error later on. We can defendagainst that by checking ph_eval_at to see if the PHV could possibly begetting used at some partner rel.Also improve some nearby LATERAL-related logic. I decided that the checkon ph_lateral needed to take precedence over the check on ph_needed, incase there's a lateral reference underneath the join being considered.(That may be impossible, but I'm not convinced of it, and it's easy enoughto defend against the case.) Also, I realized that remove_rel_from_query'slogic for updating LateralJoinInfos is dead code, because we don't buildthose at all until after join removal.Back-patch to 9.3. Previous versions didn't have the LATERAL issues, ofcourse, and they also didn't attempt to remove PlaceHolderInfos during joinremoval. (I'm starting to wonder if changing that was really such a greatidea.)1 parent846f8c9 commit89db839
File tree
3 files changed
+83
-27
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+83
-27
lines changedLines changed: 17 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
240 | 240 |
| |
241 | 241 |
| |
242 | 242 |
| |
243 |
| - | |
244 |
| - | |
245 | 243 |
| |
246 | 244 |
| |
| 245 | + | |
| 246 | + | |
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
| |||
439 | 439 |
| |
440 | 440 |
| |
441 | 441 |
| |
442 |
| - | |
443 |
| - | |
444 |
| - | |
445 |
| - | |
446 |
| - | |
447 |
| - | |
448 |
| - | |
449 |
| - | |
450 |
| - | |
451 |
| - | |
452 |
| - | |
453 |
| - | |
454 |
| - | |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
| 442 | + | |
| 443 | + | |
465 | 444 |
| |
466 | 445 |
| |
467 | 446 |
| |
468 | 447 |
| |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
469 | 458 |
| |
470 | 459 |
| |
471 | 460 |
| |
472 | 461 |
| |
473 | 462 |
| |
474 | 463 |
| |
475 |
| - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
476 | 467 |
| |
477 | 468 |
| |
478 | 469 |
| |
479 | 470 |
| |
480 | 471 |
| |
481 | 472 |
| |
482 |
| - | |
483 | 473 |
| |
484 | 474 |
| |
485 | 475 |
| |
|
Lines changed: 41 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3878 | 3878 |
| |
3879 | 3879 |
| |
3880 | 3880 |
| |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
3881 | 3922 |
| |
3882 | 3923 |
| |
3883 | 3924 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1260 | 1260 |
| |
1261 | 1261 |
| |
1262 | 1262 |
| |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1263 | 1288 |
| |
1264 | 1289 |
| |
1265 | 1290 |
| |
|
0 commit comments
Comments
(0)