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:14 +0000 (20:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:25:14 +0000 (20:25 +0000)
commitb282176e322e77a9c59db76f16f135b07105036b
tree016fcb3d13463da2fc56ceb85d05055285b50c4c
parentb9a9006f0bc656afb1051efa6daa1be39111aea4
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