- Notifications
You must be signed in to change notification settings - Fork5
Commit2057a58
committed
Fix mis-optimization of semijoins with more than one LHS relation.
The inner-unique patch (commit9c7f522) supposed that if we'reconsidering a JOIN_UNIQUE_INNER join path, we can always set inner_uniquefor the join, because the inner path produced by create_unique_path shouldbe unique relative to the outer relation. However, that's true only ifwe're considering joining to the whole outer relation --- otherwise we maybe applying only some of the join quals, and so the inner path might benon-unique from the perspective of this join. Adjust the test to onlybelieve that we can set inner_unique if we have the whole semijoin LHS onthe outer side.There is more that can be done in this area, but this commit is onlyintended to provide the minimal fix needed to get correct plans.Per report from Teodor Sigaev. Thanks to David Rowley for preliminaryinvestigation.Discussion:https://postgr.es/m/f994fc98-389f-4a46-d1bc-c42e05cb43ed@sigaev.ru1 parent74a20d0 commit2057a58
File tree
3 files changed
+44
-3
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+44
-3
lines changedLines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
129 |
| - | |
130 |
| - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 |
| |
132 | 135 |
| |
133 | 136 |
| |
| |||
138 | 141 |
| |
139 | 142 |
| |
140 | 143 |
| |
141 |
| - | |
| 144 | + | |
| 145 | + | |
142 | 146 |
| |
143 | 147 |
| |
144 | 148 |
| |
|
Lines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5634 | 5634 |
| |
5635 | 5635 |
| |
5636 | 5636 |
| |
| 5637 | + | |
| 5638 | + | |
| 5639 | + | |
| 5640 | + | |
| 5641 | + | |
| 5642 | + | |
| 5643 | + | |
| 5644 | + | |
| 5645 | + | |
| 5646 | + | |
| 5647 | + | |
| 5648 | + | |
| 5649 | + | |
| 5650 | + | |
| 5651 | + | |
| 5652 | + | |
| 5653 | + | |
| 5654 | + | |
| 5655 | + | |
| 5656 | + | |
| 5657 | + | |
| 5658 | + | |
| 5659 | + | |
| 5660 | + | |
| 5661 | + | |
| 5662 | + | |
| 5663 | + | |
| 5664 | + | |
| 5665 | + |
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1856 | 1856 |
| |
1857 | 1857 |
| |
1858 | 1858 |
| |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + |
0 commit comments
Comments
(0)