forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8c1144b
committed
Avoid believing incomplete MCV-only stats in get_variable_range().
get_variable_range() would incautiously believe that statisticscontaining only an MCV list are sufficient to derive a range estimate.That's okay for an enum-like column that contains only MCVs, butotherwise the estimate could be pretty bad. Make it report that therange is indeterminate unless the MCVs plus nullfrac account forthe whole table.I don't think this needs a dedicated test case, since a quick codecoverage check verifies that the existing regression tests traverseall the alternatives. There is room to doubt that a future-prooftest case could be built anyway, given that the submitted exampleaccidentally doesn't fail before v11.Per bug #17207 from Simon Perepelitsa. Back-patch to v10.In principle this has been broken all along, but I'm hesitant tomake such changes in 9.6, since if anyone is unhappy with 9.6.24'sbehavior there will be no second chance to fix it.Discussion:https://postgr.es/m/17207-5265aefa79e333b4@postgresql.org1 parent7b5d4c2 commit8c1144b
1 file changed
+25
-5
lines changedLines changed: 25 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5841 | 5841 |
| |
5842 | 5842 |
| |
5843 | 5843 |
| |
5844 |
| - | |
| 5844 | + | |
| 5845 | + | |
| 5846 | + | |
| 5847 | + | |
5845 | 5848 |
| |
5846 | 5849 |
| |
5847 | 5850 |
| |
5848 |
| - | |
| 5851 | + | |
| 5852 | + | |
5849 | 5853 |
| |
5850 |
| - | |
5851 |
| - | |
5852 |
| - | |
| 5854 | + | |
| 5855 | + | |
| 5856 | + | |
| 5857 | + | |
| 5858 | + | |
| 5859 | + | |
| 5860 | + | |
| 5861 | + | |
| 5862 | + | |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
| 5866 | + | |
| 5867 | + | |
| 5868 | + | |
| 5869 | + | |
| 5870 | + | |
| 5871 | + | |
| 5872 | + | |
5853 | 5873 |
| |
5854 | 5874 |
| |
5855 | 5875 |
| |
|
0 commit comments
Comments
(0)