- Notifications
You must be signed in to change notification settings - Fork5
Commit68fa28f
committed
Postpone extParam/allParam calculations until the very end of planning.
Until now we computed these Param ID sets at the end of subquery_planner,but that approach depends on subquery_planner returning a concrete Plantree. We would like to switch over to returning one or more Paths for asubquery, and in that representation the necessary details aren't fullyfleshed out (not to mention that we don't really want to do this work forPaths that end up getting discarded). Hence, refactor so that we cancompute the param ID sets at the end of planning, just beforeset_plan_references is run.The main change necessary to make this work is that we need to capturethe set of outer-level Param IDs available to the current query levelbefore exiting subquery_planner, since the outer levels' plan_params listsare transient. (That's not going to pose a problem for returning Paths,since all the work involved in producing that data is part of expressionpreprocessing, which will continue to happen before Paths are produced.)On the plus side, this change gets rid of several existing kluges.Eventually I'd like to get rid of SS_finalize_plan altogether in favor ofdoing this work during set_plan_references, but that will require somecomplex rejiggering because SS_finalize_plan needs to visit subplans andinitplans before the main plan. So leave that idea for another day.1 parent4901b2f commit68fa28f
File tree
10 files changed
+293
-158
lines changed- src
- backend
- nodes
- optimizer
- plan
- prep
- include
- nodes
- optimizer
- test/regress
- expected
- sql
10 files changed
+293
-158
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1799 | 1799 |
| |
1800 | 1800 |
| |
1801 | 1801 |
| |
| 1802 | + | |
1802 | 1803 |
| |
1803 | 1804 |
| |
1804 | 1805 |
| |
|
Lines changed: 1 addition & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4473 | 4473 |
| |
4474 | 4474 |
| |
4475 | 4475 |
| |
4476 |
| - | |
4477 |
| - | |
4478 |
| - | |
4479 |
| - | |
4480 |
| - | |
| 4476 | + | |
4481 | 4477 |
| |
4482 | 4478 |
| |
4483 | 4479 |
| |
| |||
4498 | 4494 |
| |
4499 | 4495 |
| |
4500 | 4496 |
| |
4501 |
| - | |
4502 |
| - | |
4503 |
| - | |
4504 |
| - | |
4505 | 4497 |
| |
4506 | 4498 |
| |
4507 | 4499 |
| |
|
Lines changed: 30 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
416 | 416 |
| |
417 | 417 |
| |
418 | 418 |
| |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
419 | 427 |
| |
420 | 428 |
| |
421 | 429 |
| |
422 | 430 |
| |
423 | 431 |
| |
424 |
| - | |
425 |
| - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
426 | 436 |
| |
427 | 437 |
| |
428 | 438 |
| |
| |||
577 | 587 |
| |
578 | 588 |
| |
579 | 589 |
| |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
580 | 607 |
| |
581 | 608 |
| |
582 | 609 |
| |
583 | 610 |
| |
584 |
| - | |
| 611 | + | |
585 | 612 |
| |
586 | 613 |
| |
587 | 614 |
| |
588 |
| - | |
589 |
| - | |
590 |
| - | |
591 |
| - | |
592 |
| - | |
593 |
| - | |
594 |
| - | |
595 |
| - | |
596 |
| - | |
597 |
| - | |
598 | 615 |
| |
599 | 616 |
| |
600 | 617 |
| |
|
Lines changed: 30 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
239 | 239 |
| |
240 | 240 |
| |
241 | 241 |
| |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
242 | 261 |
| |
243 | 262 |
| |
244 | 263 |
| |
| |||
312 | 331 |
| |
313 | 332 |
| |
314 | 333 |
| |
315 |
| - | |
316 | 334 |
| |
317 | 335 |
| |
318 | 336 |
| |
| |||
327 | 345 |
| |
328 | 346 |
| |
329 | 347 |
| |
| 348 | + | |
330 | 349 |
| |
331 | 350 |
| |
332 | 351 |
| |
| |||
656 | 675 |
| |
657 | 676 |
| |
658 | 677 |
| |
659 |
| - | |
660 |
| - | |
661 |
| - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
662 | 687 |
| |
663 |
| - | |
664 |
| - | |
665 |
| - | |
| 688 | + | |
666 | 689 |
| |
667 | 690 |
| |
668 | 691 |
| |
|
0 commit comments
Comments
(0)