forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7d4a10e
committed
Use PlaceHolderVars within the quals of a FULL JOIN.
This prevents failures in cases where we pull up a constant or var-freeexpression from a subquery and put it into a full join's qual. That canresult in not recognizing the qual as containing a mergejoin-able orhashjoin-able condition. A PHV prevents the problem because it is stillrecognized as belonging to the side of the join the subquery is in.I'm not very sure about the net effect of this change on plan quality.In "typical" cases where the join keys are Vars, nothing changes.In an affected case, the PHV-wrapped expression is less likely to be seenas equal to PHV-less instances below the join, but more likely to be seenas equal to similar expressions above the join, so it may end up being awash. In the one existing case where there's any visible change in aregression-test plan, it amounts to referencing a lower computation of aCOALESCE result instead of recomputing it, which seems like a win.Given my uncertainty about that and the lack of field complaints,no back-patch, even though this is a very ancient problem.Discussion:https://postgr.es/m/32090.1539378124@sss.pgh.pa.us1 parente9f42d5 commit7d4a10e
File tree
3 files changed
+34
-1
lines changed- src
- backend/optimizer/prep
- test/regress
- expected
- sql
3 files changed
+34
-1
lines changedLines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2044 | 2044 |
| |
2045 | 2045 |
| |
2046 | 2046 |
| |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2047 | 2059 |
| |
2048 | 2060 |
| |
2049 | 2061 |
| |
|
Lines changed: 15 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2024 | 2024 |
| |
2025 | 2025 |
| |
2026 | 2026 |
| |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
2027 | 2041 |
| |
2028 | 2042 |
| |
2029 | 2043 |
| |
| |||
2854 | 2868 |
| |
2855 | 2869 |
| |
2856 | 2870 |
| |
2857 |
| - | |
| 2871 | + | |
2858 | 2872 |
| |
2859 | 2873 |
| |
2860 | 2874 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
297 | 297 |
| |
298 | 298 |
| |
299 | 299 |
| |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
300 | 307 |
| |
301 | 308 |
| |
302 | 309 |
| |
|
0 commit comments
Comments
(0)