Rewrite pg_dump's comment-dumping code to pull over all the comments in one query, rather than making a separate query for each object that could have a comment.  This costs relatively little space (a few tens of K typically) and saves substantial time in databases with many objects. I find it reduces the runtime of 'pg_dump -s regression' by about a third.
Rewrite pg_dump's comment-dumping code to pull over all the comments
in one query, rather than making a separate query for each object that
could have a comment.  This costs relatively little space (a few tens of
K typically) and saves substantial time in databases with many objects.
I find it reduces the runtime of 'pg_dump -s regression' by about a
third.

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