forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdbd68df
committed
Guard against input_rows == 0 in estimate_num_groups().
This case doesn't normally happen, because the planner usually clampsall row estimates to at least one row; but I found that it can arisewhen dealing with relations excluded by constraints. Without a defense,estimate_num_groups() can return zero, which leads to divisions by zeroinside the planner as well as assertion failures in the executor.An alternative fix would be to change set_dummy_rel_pathlist() to makethe size estimate for a dummy relation 1 row instead of 0, but that seemedpretty ugly; and probably someday we'll want to drop the convention thatthe minimum rowcount estimate is 1 row.Back-patch to 8.4, as the problem can be demonstrated that far back.1 parent53cdc3e commitdbd68df
1 file changed
+8
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3055 | 3055 |
| |
3056 | 3056 |
| |
3057 | 3057 |
| |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
3058 | 3066 |
| |
3059 | 3067 |
| |
3060 | 3068 |
| |
|
0 commit comments
Comments
(0)