forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit69cc60d
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 parent477b5a0 commit69cc60d
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3209 | 3209 | | |
3210 | 3210 | | |
3211 | 3211 | | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
3212 | 3220 | | |
3213 | 3221 | | |
3214 | 3222 | | |
| |||
0 commit comments
Comments
(0)