forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8e992b0
committed
Fix booltestsel() for case where we have NULL stats but not MCV stats.
In a boolean column that contains mostly nulls, ANALYZE might not findenough non-null values to populate the most-common-values stats,but it would still create a pg_statistic entry with stanullfrac set.The logic in booltestsel() for this situation did the wrong thing for"col IS NOT TRUE" and "col IS NOT FALSE" tests, forgetting that nullvalues would satisfy these tests (so that the true selectivity wouldbe close to one, not close to zero). Per bug #8274.Fix by Andrew Gierth, some comment-smithing by me.1 parentf6a6d20 commit8e992b0
1 file changed
+10
-12
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1494 | 1494 |
| |
1495 | 1495 |
| |
1496 | 1496 |
| |
1497 |
| - | |
| 1497 | + | |
1498 | 1498 |
| |
1499 | 1499 |
| |
1500 | 1500 |
| |
1501 | 1501 |
| |
1502 |
| - | |
1503 |
| - | |
1504 |
| - | |
1505 |
| - | |
| 1502 | + | |
1506 | 1503 |
| |
1507 | 1504 |
| |
1508 | 1505 |
| |
1509 |
| - | |
1510 |
| - | |
1511 |
| - | |
1512 |
| - | |
1513 |
| - | |
| 1506 | + | |
1514 | 1507 |
| |
1515 | 1508 |
| |
1516 | 1509 |
| |
1517 |
| - | |
1518 | 1510 |
| |
1519 |
| - | |
| 1511 | + | |
1520 | 1512 |
| |
1521 | 1513 |
| |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1522 | 1520 |
| |
1523 | 1521 |
| |
1524 | 1522 |
| |
|
0 commit comments
Comments
(0)