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.
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.

yuanzhao/gpdb,oberstet/postgres-xl,yazun/postgres-xl,Chibin/gpdb,arcivanov/postgres-xl,lisakowen/gpdb,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,snaga/postgres-xl,oberstet/postgres-xl,techdragon/Postgres-XL,kmjungersen/PostgresXL,jmcatamney/gpdb,xinzweb/gpdb,yuanzhao/gpdb,kmjungersen/PostgresXL,ashwinstar/gpdb,ovr/postgres-xl,ovr/postgres-xl,kmjungersen/PostgresXL,Chibin/gpdb,Chibin/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,edespino/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,techdragon/Postgres-XL,arcivanov/postgres-xl,adam8157/gpdb,zeroae/postgres-xl,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,jmcatamney/gpdb,edespino/gpdb,ashwinstar/gpdb,techdragon/Postgres-XL,50wu/gpdb,edespino/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,snaga/postgres-xl,jmcatamney/gpdb,postmind-net/postgres-xl,Chibin/gpdb,50wu/gpdb,50wu/gpdb,techdragon/Postgres-XL,postmind-net/postgres-xl,tpostgres-projects/tPostgres,oberstet/postgres-xl,jmcatamney/gpdb,tpostgres-projects/tPostgres,Chibin/gpdb,arcivanov/postgres-xl,adam8157/gpdb,adam8157/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,snaga/postgres-xl,greenplum-db/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,greenplum-db/gpdb,Chibin/gpdb,50wu/gpdb,yuanzhao/gpdb,Chibin/gpdb,Chibin/gpdb,adam8157/gpdb,postmind-net/postgres-xl,snaga/postgres-xl,edespino/gpdb,arcivanov/postgres-xl,yuanzhao/gpdb,yuanzhao/gpdb,pavanvd/postgres-xl,arcivanov/postgres-xl,jmcatamney/gpdb,zeroae/postgres-xl,ashwinstar/gpdb,Chibin/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,arcivanov/postgres-xl,ashwinstar/gpdb,Chibin/gpdb,ashwinstar/gpdb,lisakowen/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,zeroae/postgres-xl,yuanzhao/gpdb,postmind-net/postgres-xl,ovr/postgres-xl,edespino/gpdb,lisakowen/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,kmjungersen/PostgresXL,pavanvd/postgres-xl,lisakowen/gpdb,postmind-net/postgres-xl,greenplum-db/gpdb,adam8157/gpdb,zeroae/postgres-xl,edespino/gpdb,xinzweb/gpdb,edespino/gpdb,edespino/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,snaga/postgres-xl,50wu/gpdb,tpostgres-projects/tPostgres,kmjungersen/PostgresXL,oberstet/postgres-xl,ovr/postgres-xl,lisakowen/gpdb,50wu/gpdb,pavanvd/postgres-xl,edespino/gpdb,xinzweb/gpdb,yazun/postgres-xl,lisakowen/gpdb,xinzweb/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,yuanzhao/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,ashwinstar/gpdb,ashwinstar/gpdb