Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 756aeaf0f3ca5e17908ae728b20eadea85e76565
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-07-07T20:25:30Z
Releases: 8.0.18
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.

Files

PathChange+/−
src/backend/utils/adt/selfuncs.c modified +32 −12