Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:25:30 +0000 (20:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:25:30 +0000 (20:25 +0000)
commit44b47913db2135e7bf64a0f74d68d0f8208b29fb
tree2b8e02689dd2d3d4250fa057717c266bd9b35517
parentc0a78a45ce41d34fc7132c66214a7c91e2563f88
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