Re: Push down Aggregates below joins

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Push down Aggregates below joins
Date: 2018-07-01 11:40:55
Message-ID: 3b66fdb3-a121-5be7-e44e-aa8ec40a933a@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20.06.18 22:12, Heikki Linnakangas wrote:
> Currently, the planner always first decides the scan/join order, and
> adds Group/Agg nodes on top of the joins. Sometimes it would be legal,
> and beneficial, to perform the aggregation below a join. I've been
> hacking on a patch to allow that.

Because this patch moves a lot of code around, there are nontrivial
conflicts now. I was able to apply it on top of
fb6accd27b99f5f91a7e9e5bd32b98a53fc6d6b8 based on the date.

With that, I'm getting test failures in partition_aggregate, like this

Sort
Sort Key: t2.y, (sum(t1.y)), (count(*))
- -> Append
- -> HashAggregate
- Group Key: t2.y
...
+ -> Result
+ -> Append
+ -> HashAggregate
+ Group Key: t1.x
...

And there is apparently no expected/aggregate_pushdown.out file in the
patch set.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-07-01 11:43:50 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Michael Paquier 2018-07-01 11:39:50 Re: location reporting in TAP test failures