Fix thinko in estimate_num_groups
Alvaro Herrera <alvherre@alvh.no-ip.org>
Fix thinko in estimate_num_groups The code for the reworked n-distinct estimation on commit 7b504eb282 was written differently in a previous version of the patch, prior to commit; on rewriting it, we missed updating an initializer. This caused the code to (mistakenly) apply a fudge factor even in the case where a single value is applied, leading to incorrect results. This means that the 'relvarcount' variable name is now wrong. Add a comment to try and make the situation clearer, and remove an incorrect comment I added. Problem noticed, and code patch, by Tomas Vondra. Additional commentary by Álvaro.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/selfuncs.c | modified | +6 −2 |