forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8d96f57
committed
Improve planner's handling of SetOp plans.
Remove the code for inserting flag columns in the inputs of a SetOp.That was the only reason why there would be resjunk columns in aset-operations plan tree, so we can get rid of some code thatsupported that, too.Get rid of choose_hashed_setop() in favor of building Paths forthe hashed and sorted alternatives, and letting them fight it outwithin add_path().Remove set_operation_ordered_results_useful(), which was giving wronganswers due to examining the wrong ancestor node: we need to examinethe immediate SetOperationStmt parent not the topmost node. Insteadmake each caller of recurse_set_operations() pass down the relevantparent node. (This thinko seems to have led only to wasted planningcycles and possibly-inferior plans, not wrong query answers. Perhapswe should back-patch it, but I'm not doing so right now.)Teach generate_nonunion_paths() to consider pre-sorted inputs forsorted SetOps, rather than always generating a Sort node.Patch by me; thanks to Richard Guo and David Rowley for review.Discussion:https://postgr.es/m/1850138.1731549611@sss.pgh.pa.us1 parent2762792 commit8d96f57
File tree
8 files changed
+365
-332
lines changed- src
- backend/optimizer
- plan
- prep
- util
- include/optimizer
- test/regress
- expected
- sql
8 files changed
+365
-332
lines changedLines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
616 | 616 |
| |
617 | 617 |
| |
618 | 618 |
| |
619 |
| - | |
| 619 | + | |
620 | 620 |
| |
621 | 621 |
| |
622 | 622 |
| |
| |||
1350 | 1350 |
| |
1351 | 1351 |
| |
1352 | 1352 |
| |
1353 |
| - | |
| 1353 | + | |
1354 | 1354 |
| |
1355 | 1355 |
| |
1356 | 1356 |
| |
| |||
3467 | 3467 |
| |
3468 | 3468 |
| |
3469 | 3469 |
| |
3470 |
| - | |
3471 |
| - | |
| 3470 | + | |
3472 | 3471 |
| |
3473 | 3472 |
| |
3474 | 3473 |
| |
|
0 commit comments
Comments
(0)