Commit 391159e
committed
Partially revert commit 3d3bf62.
On reflection, the pre-existing logic in ANALYZE is specifically meant to
compare the frequency of a candidate MCV against the estimated frequency of
a random distinct value across the whole table. The change to compare it
against the average frequency of values actually seen in the sample doesn't
seem very principled, and if anything it would make us less likely not more
likely to consider a value an MCV. So revert that, but keep the aspect of
considering only nonnull values, which definitely is correct.
In passing, rename the local variables in these stanzas to
"ndistinct_table", to avoid confusion with the "ndistinct" that appears at
an outer scope in compute_scalar_stats.1 parent c9ff752 commit 391159e
1 file changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2133 | 2133 | | |
2134 | 2134 | | |
2135 | 2135 | | |
2136 | | - | |
2137 | | - | |
| 2136 | + | |
2138 | 2137 | | |
2139 | 2138 | | |
2140 | 2139 | | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
2141 | 2143 | | |
2142 | | - | |
| 2144 | + | |
2143 | 2145 | | |
2144 | 2146 | | |
2145 | 2147 | | |
| |||
2493 | 2495 | | |
2494 | 2496 | | |
2495 | 2497 | | |
2496 | | - | |
2497 | | - | |
| 2498 | + | |
2498 | 2499 | | |
2499 | 2500 | | |
2500 | 2501 | | |
2501 | 2502 | | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2502 | 2506 | | |
2503 | | - | |
| 2507 | + | |
2504 | 2508 | | |
2505 | 2509 | | |
2506 | 2510 | | |
| |||
0 commit comments