forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1007b0a
committed
Fix hashjoin costing mistake introduced with inner_unique optimization.
In final_cost_hashjoin(), commit9c7f522 allowed inner_unique casesto follow a code path previously used only for SEMI/ANTI joins; but itneglected to fix an if-test within that path that assumed SEMI and ANTIwere the only possible cases. This resulted in a wrong value forhashjointuples, and an ensuing bad cost estimate, for inner_unique normaljoins. Fortunately, for inner_unique normal joins we can assume the numberof joined tuples is the same as for a SEMI join; so there's no need formore code, we just have to invert the test to check for ANTI not SEMI.It turns out that in two contrib tests in which commit9c7f522changed the plan expected for a query, the change was actually wrongand induced by this estimation error, not by any real improvement.Hence this patch also reverts those changes.Per report from RK Korlapati. Backpatch to v10 where the error wasintroduced.David RowleyDiscussion:https://postgr.es/m/CA+SNy03bhq0fodsfOkeWDCreNjJVjsdHwUsb7AG=jpe0PtZc_g@mail.gmail.com1 parent28a1ae5 commit1007b0a
File tree
4 files changed
+16
-13
lines changed- contrib
- citext/expected
- postgres_fdw/expected
- src/backend/optimizer/path
4 files changed
+16
-13
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2336 | 2336 |
| |
2337 | 2337 |
| |
2338 | 2338 |
| |
2339 |
| - | |
2340 | 2339 |
| |
| 2340 | + | |
2341 | 2341 |
| |
2342 | 2342 |
| |
2343 | 2343 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2336 | 2336 |
| |
2337 | 2337 |
| |
2338 | 2338 |
| |
2339 |
| - | |
2340 | 2339 |
| |
| 2340 | + | |
2341 | 2341 |
| |
2342 | 2342 |
| |
2343 | 2343 |
| |
|
Lines changed: 11 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4233 | 4233 |
| |
4234 | 4234 |
| |
4235 | 4235 |
| |
4236 |
| - | |
4237 |
| - | |
4238 |
| - | |
| 4236 | + | |
| 4237 | + | |
| 4238 | + | |
4239 | 4239 |
| |
4240 |
| - | |
4241 |
| - | |
4242 |
| - | |
4243 |
| - | |
| 4240 | + | |
| 4241 | + | |
4244 | 4242 |
| |
4245 | 4243 |
| |
4246 | 4244 |
| |
4247 |
| - | |
| 4245 | + | |
| 4246 | + | |
| 4247 | + | |
| 4248 | + | |
| 4249 | + | |
| 4250 | + | |
4248 | 4251 |
| |
4249 | 4252 |
| |
4250 | 4253 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3454 | 3454 |
| |
3455 | 3455 |
| |
3456 | 3456 |
| |
3457 |
| - | |
3458 |
| - | |
3459 |
| - | |
| 3457 | + | |
3460 | 3458 |
| |
| 3459 | + | |
| 3460 | + | |
3461 | 3461 |
| |
3462 | 3462 |
| |
3463 | 3463 |
| |
|
0 commit comments
Comments
(0)