Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean
commit4a54396b8e581df74f133b0cf90c516448406309
authortgl <tgl>
Mon, 7 Jul 2008 20:24:55 +0000 (7 20:24 +0000)
committertgl <tgl>
Mon, 7 Jul 2008 20:24:55 +0000 (7 20:24 +0000)
treef65415ed0a69ea5e3231b6682bf55175eba0a946
parentd308b9beb4864f3fac965a2702d0b4ccd49df7da
Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean
results always contribute two groups, regardless of the expression contents.
This is very substantially more accurate than the regular heuristic for
certain boolean tests like "col IS NULL".  Per gripe from Sam Mason.

Back-patch to all supported releases, since the behavior of
estimate_num_groups() hasn't changed all that much since 7.4.
src/backend/utils/adt/selfuncs.c