Split out into a separate function the code in grouping_planner() that decides whether to use hashed grouping instead of sort-plus-uniq grouping. The function needs an annoyingly large number of parameters, but this still seems like a win for legibility, since it removes over a hundred lines from grouping_planner (which is still too big :-().
Split out into a separate function the code in grouping_planner() that
decides whether to use hashed grouping instead of sort-plus-uniq
grouping. The function needs an annoyingly large number of parameters,
but this still seems like a win for legibility, since it removes over
a hundred lines from grouping_planner (which is still too big :-().

atris/gpdb,yuanzhao/gpdb,oberstet/postgres-xl,CraigHarris/gpdb,lisakowen/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,Quikling/gpdb,zeroae/postgres-xl,xinzweb/gpdb,zeroae/postgres-xl,jmcatamney/gpdb,Chibin/gpdb,ovr/postgres-xl,xinzweb/gpdb,edespino/gpdb,tangp3/gpdb,royc1/gpdb,kaknikhil/gpdb,rubikloud/gpdb,CraigHarris/gpdb,Chibin/gpdb,lintzc/gpdb,ahachete/gpdb,janebeckman/gpdb,lisakowen/gpdb,ahachete/gpdb,adam8157/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,Quikling/gpdb,50wu/gpdb,postmind-net/postgres-xl,ovr/postgres-xl,kmjungersen/PostgresXL,chrishajas/gpdb,greenplum-db/gpdb,Quikling/gpdb,cjcjameson/gpdb,edespino/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,snaga/postgres-xl,chrishajas/gpdb,CraigHarris/gpdb,rubikloud/gpdb,yazun/postgres-xl,kmjungersen/PostgresXL,yazun/postgres-xl,atris/gpdb,rubikloud/gpdb,50wu/gpdb,50wu/gpdb,ahachete/gpdb,chrishajas/gpdb,50wu/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,ashwinstar/gpdb,rvs/gpdb,ashwinstar/gpdb,atris/gpdb,foyzur/gpdb,kaknikhil/gpdb,Quikling/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,arcivanov/postgres-xl,arcivanov/postgres-xl,xuegang/gpdb,lpetrov-pivotal/gpdb,lintzc/gpdb,atris/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,edespino/gpdb,chrishajas/gpdb,lintzc/gpdb,xinzweb/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,janebeckman/gpdb,randomtask1155/gpdb,techdragon/Postgres-XL,royc1/gpdb,Chibin/gpdb,xuegang/gpdb,royc1/gpdb,yuanzhao/gpdb,tangp3/gpdb,Chibin/gpdb,lpetrov-pivotal/gpdb,janebeckman/gpdb,ahachete/gpdb,edespino/gpdb,royc1/gpdb,techdragon/Postgres-XL,snaga/postgres-xl,arcivanov/postgres-xl,CraigHarris/gpdb,janebeckman/gpdb,tpostgres-projects/tPostgres,chrishajas/gpdb,rvs/gpdb,kaknikhil/gpdb,foyzur/gpdb,Chibin/gpdb,kaknikhil/gpdb,lintzc/gpdb,0x0FFF/gpdb,0x0FFF/gpdb,zaksoup/gpdb,Chibin/gpdb,royc1/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,edespino/gpdb,50wu/gpdb,atris/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,adam8157/gpdb,rvs/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,zaksoup/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,edespino/gpdb,lintzc/gpdb,tpostgres-projects/tPostgres,randomtask1155/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,atris/gpdb,ashwinstar/gpdb,50wu/gpdb,adam8157/gpdb,janebeckman/gpdb,tpostgres-projects/tPostgres,0x0FFF/gpdb,atris/gpdb,pavanvd/postgres-xl,Quikling/gpdb,Quikling/gpdb,0x0FFF/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,ahachete/gpdb,rvs/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,zaksoup/gpdb,janebeckman/gpdb,ahachete/gpdb,ovr/postgres-xl,rvs/gpdb,0x0FFF/gpdb,atris/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,chrishajas/gpdb,foyzur/gpdb,Postgres-XL/Postgres-XL,tangp3/gpdb,yazun/postgres-xl,lintzc/gpdb,rubikloud/gpdb,yazun/postgres-xl,janebeckman/gpdb,lpetrov-pivotal/gpdb,Quikling/gpdb,greenplum-db/gpdb,yazun/postgres-xl,xuegang/gpdb,randomtask1155/gpdb,foyzur/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,oberstet/postgres-xl,chrishajas/gpdb,snaga/postgres-xl,cjcjameson/gpdb,kmjungersen/PostgresXL,royc1/gpdb,pavanvd/postgres-xl,0x0FFF/gpdb,CraigHarris/gpdb,Quikling/gpdb,Quikling/gpdb,greenplum-db/gpdb,ahachete/gpdb,CraigHarris/gpdb,edespino/gpdb,zeroae/postgres-xl,lintzc/gpdb,lisakowen/gpdb,Chibin/gpdb,xuegang/gpdb,jmcatamney/gpdb,lisakowen/gpdb,adam8157/gpdb,snaga/postgres-xl,cjcjameson/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,Postgres-XL/Postgres-XL,postmind-net/postgres-xl,Chibin/gpdb,cjcjameson/gpdb,tangp3/gpdb,zaksoup/gpdb,zaksoup/gpdb,randomtask1155/gpdb,xinzweb/gpdb,ahachete/gpdb,edespino/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,arcivanov/postgres-xl,tpostgres-projects/tPostgres,janebeckman/gpdb,postmind-net/postgres-xl,rubikloud/gpdb,ovr/postgres-xl,tangp3/gpdb,foyzur/gpdb,xinzweb/gpdb,adam8157/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,cjcjameson/gpdb,Chibin/gpdb,edespino/gpdb,rvs/gpdb,xuegang/gpdb,tangp3/gpdb,ashwinstar/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,adam8157/gpdb,rubikloud/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,techdragon/Postgres-XL,zeroae/postgres-xl,greenplum-db/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,snaga/postgres-xl,lpetrov-pivotal/gpdb,ashwinstar/gpdb,edespino/gpdb,arcivanov/postgres-xl,zaksoup/gpdb,kmjungersen/PostgresXL,lintzc/gpdb,xuegang/gpdb,adam8157/gpdb,arcivanov/postgres-xl,xuegang/gpdb,rubikloud/gpdb,xuegang/gpdb,rvs/gpdb,ovr/postgres-xl,janebeckman/gpdb,lpetrov-pivotal/gpdb,Quikling/gpdb,kaknikhil/gpdb,rvs/gpdb,tangp3/gpdb,rubikloud/gpdb,foyzur/gpdb,Postgres-XL/Postgres-XL,royc1/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,50wu/gpdb,foyzur/gpdb,ashwinstar/gpdb,chrishajas/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,0x0FFF/gpdb,zaksoup/gpdb,yuanzhao/gpdb,lpetrov-pivotal/gpdb,royc1/gpdb,lisakowen/gpdb,janebeckman/gpdb,lisakowen/gpdb,adam8157/gpdb,tangp3/gpdb,foyzur/gpdb,randomtask1155/gpdb,rvs/gpdb,techdragon/Postgres-XL,rvs/gpdb,yuanzhao/gpdb,xuegang/gpdb,xinzweb/gpdb,jmcatamney/gpdb,Chibin/gpdb