Re: Partial Aggregation / GROUP BY before JOIN
От | Amit Langote |
---|---|
Тема | Re: Partial Aggregation / GROUP BY before JOIN |
Дата | |
Msg-id | 5609DA34.7000306@lab.ntt.co.jp обсуждение исходный текст |
Ответ на | Re: Partial Aggregation / GROUP BY before JOIN (David Rowley <david.rowley@2ndquadrant.com>) |
Список | pgsql-hackers |
On 2015/09/28 20:58, David Rowley wrote: > On 28 September 2015 at 23:17, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> > wrote: >> Moreover, would partial aggregation work below Append? >> > > Do you mean for cases like: > > create table a as select x.x a from generate_series(1,1000000) x(x); > select sum(a) from (select a from a union all select a from a) a; > > to allow the aggregation to happen before the append? > Yes. > On testing this I do see that writing the query as: > > select sum(a) from (select sum(a) a from a union all select sum(a) from a) > a; > > causes it to execute marginally faster. 174.280 ms vs 153.498 ms on my > laptop. > However pushing aggregation below Append nodes is not something I'm aiming > to do for this patch. I see. I recall reading in archives that pushing aggregates below append was not found to make much difference as your little test suggests, too. Thanks, Amit
В списке pgsql-hackers по дате отправления: