forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb448f1c
committed
Do assorted mop-up in the planner.
Remove RestrictInfo.nullable_relids, along with a good deal ofinfrastructure that calculated it. One use-case for it was injoin_clause_is_movable_to, but we can now replace that usage witha check to see if the clause's relids include any outer jointhat can null the target relation. The other use-case was injoin_clause_is_movable_into, but that test can just be droppedentirely now that the clause's relids include outer joins.Furthermore, join_clause_is_movable_into should now beaccurate enough that it will accept anything returned bygenerate_join_implied_equalities, so we can restore the Assertthat was diked out in commit95f4e59.Remove the outerjoin_delayed mechanism. We needed this before toprevent quals from getting evaluated below outer joins that shouldnull some of their vars. Now that we consider varnullingrels whileplacing quals, that's taken care of automatically, so throw thewhole thing away.Teach remove_useless_result_rtes to also remove useless FromExprs.Having done that, the delay_upper_joins flag serves no purpose anymore and we can remove it, largely reverting11086f2.Use constant TRUE for "dummy" clauses when throwing back outer joins.This improves on a hack I introduced in commit6a65225. If wehave a left-join clause l.x = r.y, and a WHERE clause l.x = constant,we generate r.y = constant and then don't really have a need for thejoin clause. But we must throw the join clause back anyway aftermarking it redundant, so that the join search heuristics won't thinkthis is a clauseless join and avoid it. That was a kluge introducedunder time pressure, and after looking at it I thought of a betterway: let's just introduce constant-TRUE "join clauses" instead,and get rid of them at the end. This improves the generated plans forsuch cases by not having to test a redundant join clause. We can alsoget rid of the ugly hack used to mark such clauses as redundant forselectivity estimation.Patch by me; thanks to Richard Guo for review.Discussion:https://postgr.es/m/830269.1656693747@sss.pgh.pa.us1 parent2489d76 commitb448f1c
File tree
24 files changed
+325
-763
lines changed- contrib/postgres_fdw
- src
- backend/optimizer
- path
- plan
- prep
- util
- include
- nodes
- optimizer
- test/regress
- expected
- sql
24 files changed
+325
-763
lines changedLines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6522 | 6522 |
| |
6523 | 6523 |
| |
6524 | 6524 |
| |
6525 |
| - | |
6526 | 6525 |
| |
6527 | 6526 |
| |
6528 |
| - | |
6529 | 6527 |
| |
6530 | 6528 |
| |
6531 | 6529 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2745 | 2745 |
| |
2746 | 2746 |
| |
2747 | 2747 |
| |
2748 |
| - | |
2749 | 2748 |
| |
2750 | 2749 |
| |
2751 | 2750 |
| |
|
Lines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
715 | 715 |
| |
716 | 716 |
| |
717 | 717 |
| |
718 |
| - | |
719 |
| - | |
720 |
| - | |
721 |
| - | |
722 |
| - | |
723 |
| - | |
724 | 718 |
| |
725 | 719 |
| |
726 | 720 |
| |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4787 | 4787 |
| |
4788 | 4788 |
| |
4789 | 4789 |
| |
4790 |
| - | |
4791 | 4790 |
| |
4792 | 4791 |
| |
4793 | 4792 |
| |
| |||
4956 | 4955 |
| |
4957 | 4956 |
| |
4958 | 4957 |
| |
4959 |
| - | |
4960 | 4958 |
| |
4961 | 4959 |
| |
4962 | 4960 |
| |
|
0 commit comments
Comments
(0)