]> granicus.if.org Git - postgresql/commit
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:06 +0000 (20:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:25:06 +0000 (20:25 +0000)
commita4845efaab55eebaa36cfa2701b25bd21d4dca57
treecdd7d2224d88288bec6f785118c599f5766c8c6e
parent75c2e394328311d1cf8821d9684eed6df2d5c4fa
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