forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6401583
committed
Call set_rel_pathlist_hook before generate_gather_paths, not after.
The previous ordering of these steps satisfied the nominal requirementthat set_rel_pathlist_hook could editorialize on the whole set of Pathsconstructed for a base relation. In practice, though, trying to changethe set of partial paths was impossible. Adding one didn't work because(a) it was too late to be included in Gather paths made by the core code,and (b) calling add_partial_path after generate_gather_paths is unsafe,because it might try to delete a path it thinks is dominated, but thatis already embedded in some Gather path(s). Nor could the hook safelyremove partial paths, for the same reason that they might already beembedded in Gathers.Better to call extensions first, let them add partial paths as desired,and then gather. In v11 and up, we already doubled down on that orderingby postponing gathering even further for single-relation queries; so evenif the hook wished to editorialize on Gather path construction, it couldnot.Report and patch by KaiGai Kohei. Back-patch to 9.6 where Gather pathswere added.Discussion:https://postgr.es/m/CAOP8fzahwpKJRTVVTqo2AE=mDTz_efVzV6Get_0=U3SO+-ha1A@mail.gmail.com1 parent4446565 commit6401583
File tree
2 files changed
+17
-13
lines changed- doc/src/sgml
- src/backend/optimizer/path
2 files changed
+17
-13
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
41 |
| - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
42 | 43 |
| |
43 | 44 |
| |
44 | 45 |
| |
|
Lines changed: 14 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
529 | 529 |
| |
530 | 530 |
| |
531 | 531 |
| |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
532 | 541 |
| |
533 | 542 |
| |
534 |
| - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
535 | 546 |
| |
536 | 547 |
| |
537 | 548 |
| |
538 | 549 |
| |
539 | 550 |
| |
540 | 551 |
| |
541 | 552 |
| |
542 |
| - | |
543 |
| - | |
| 553 | + | |
| 554 | + | |
544 | 555 |
| |
545 | 556 |
| |
546 | 557 |
| |
547 | 558 |
| |
548 | 559 |
| |
549 |
| - | |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
556 |
| - | |
557 | 560 |
| |
558 | 561 |
| |
559 | 562 |
| |
|
0 commit comments
Comments
(0)