Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:24:55 +0000 (20:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:24:55 +0000 (20:24 +0000)
commit170063cd1ee1fdac0a8e2bf103f3e8f65306db17
tree89f4a37789c840d53146731f4d5d231682d309bd
parentc50838533bf4cca813e0a6f60808041f551ce606
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