]> git.ipfire.org Git - thirdparty/postgresql.git/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:30 +0000 (20:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 20:25:30 +0000 (20:25 +0000)
commit756aeaf0f3ca5e17908ae728b20eadea85e76565
tree5121b117f2f725dfa5b35f0db4df49c0742bb362
parent2d94cf6bfe9cf356e086ee6d6a717cc48949f41d
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