Fix estimate_num_groups() to assume that GROUP BY expressions yielding boolean
authorTom Lane <[email protected]>
Mon, 7 Jul 2008 20:25:40 +0000 (20:25 +0000)
committerTom Lane <[email protected]>
Mon, 7 Jul 2008 20:25:40 +0000 (20:25 +0000)
commitc27f03b62645e183b938a34083257c43df224dab
tree8f8f658d005e5307f9ff340f81a8bb7e2b25a4c8
parent96e1e15ff8e5bef0580d4de0f1ad422915bdbb4f
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