I think we should try to measure performance gain because of aggregate pushdown. The EXPLAIN
doesn't show actual improvement in the execution times.
I did performance testing for aggregate push down and see good performance with the patch.
Attached is the script I have used to get the performance numbers along with the results I got with and without patch (pg_agg_push_down_v3.patch). Also attached few GNU plots from the readings I got. These were run on my local VM having following details:
Linux centos7 3.10.0-327.28.3.el7.x86_64 #1 SMP Thu Aug 18 19:05:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux RAM alloted: 8 GB CPUs alloted: 8 postgresql.conf is default.
With aggregate push down I see around 12x performance for count(*) operation. In another test, I have observed that if number of groups returned from remote server is same as that of input rows, then aggregate push down performs slightly poor which I think is expected. However in all other cases where number of groups are less than input rows, pushing down aggregate gives better performance than performing grouping on the local server.
I did this performance testing on my local setup. I would expected even better numbers on a specialized high-end performance machine. I would be more than happy if someone does this testing on such high-end machine.
Let me know if you need any help.
Thanks
--
Jeevan B Chalke Principal Software Engineer, Product Development EnterpriseDB Corporation The Enterprise PostgreSQL Company