forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit600c241
committed
Relax some asserts in merge join costing code
In the planner, it was possible, given an extreme enough case containing alarge number of joins for the number of estimated rows to become infinite.This could cause problems in initial_cost_mergejoin() where we performsome calculations based on those row estimates.A problem case, presented by Onder Kalaci showed an Assert failure froman Assert checking outerstartsel <= outerendsel. In his test case thiswas effectively NaN <= Inf, which is false. The NaN outerstartsel camefrom multiplying the infinite outer_path_rows by 0.0.In master, this problem was fixed bya90c950, however, that fix was tooinvasive for the backbranches. Here we just relax the Asserts to allowthem to pass. The worst that appears to happen from this is that we showNaN cost values and infinite row estimates in EXPLAIN. add_path() wouldhave had a hard time doing anything useful with such costs, but that doesnot really matter as if the row estimates were even close to accurate,such plan would not complete this side of the heat death of the universe.Reported-by: Onder KalaciBackpatch: 9.5 to 13Discussion:https://postgr.es/m/DM6PR21MB1211FF360183BCA901B27F04D80B0@DM6PR21MB1211.namprd21.prod.outlook.com1 parente8d36f9 commit600c241
1 file changed
+6
-4
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2477 | 2477 |
| |
2478 | 2478 |
| |
2479 | 2479 |
| |
2480 |
| - | |
2481 |
| - | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
2482 | 2483 |
| |
2483 | 2484 |
| |
2484 | 2485 |
| |
| |||
2490 | 2491 |
| |
2491 | 2492 |
| |
2492 | 2493 |
| |
2493 |
| - | |
2494 |
| - | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
2495 | 2497 |
| |
2496 | 2498 |
| |
2497 | 2499 |
| |
|
0 commit comments
Comments
(0)