Re: WIP: Aggregation push-down - take2

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: "Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp" <Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "david(at)pgmasters(dot)net" <david(at)pgmasters(dot)net>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "zhihui(dot)fan1213(at)gmail(dot)com" <zhihui(dot)fan1213(at)gmail(dot)com>, "legrand_legrand(at)hotmail(dot)com" <legrand_legrand(at)hotmail(dot)com>, "daniel(at)yesql(dot)se" <daniel(at)yesql(dot)se>
Subject: Re: WIP: Aggregation push-down - take2
Date: 2022-11-04 14:17:15
Message-ID: 89085.1667571435@antos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com> wrote:

> Hi,
>
> On 7/12/22 08:49, Fujii(dot)Yuki(at)df(dot)MitsubishiElectric(dot)co(dot)jp wrote:
> > Hi everyone.
> >
> > I rebased the following patches which were submitted in [1].
> > v17-0001-Introduce-RelInfoList-structure.patch
> > v17-0002-Aggregate-push-down-basic-functionality.patch
> > v17-0003-Use-also-partial-paths-as-the-input-for-grouped-path.patch
> >
> > I checked I can apply the rebased patch to commit 2cd2569c72b8920048e35c31c9be30a6170e1410.
> >
> > I'm going to register the rebased patch in next commitfest.
> >
> I've started looking at this patch series again, but I wonder what's the
> plan. The last patch version no longer applies, so I rebased it - see
> the attachment. The failures were pretty minor, but there're two warnings:
>
> pathnode.c:3174:11: warning: variable 'agg_exprs' set but not used
> [-Wunused-but-set-variable]
> Node *agg_exprs;
> ^
> pathnode.c:3252:11: warning: variable 'agg_exprs' set but not used
> [-Wunused-but-set-variable]
> Node *agg_exprs;
> ^
>
> so there seem to be some loose ends. Moreover, there are two failures in
> make check, due to plan changes like this:
>
> + Finalize GroupAggregate
> Group Key: p.i
> - -> Nested Loop
> - -> Partial HashAggregate
> - Group Key: c1.parent
> - -> Seq Scan on agg_pushdown_child1 c1
> - -> Index Scan using agg_pushdown_parent_pkey on ...
> - Index Cond: (i = c1.parent)
> -(8 rows)
> + -> Sort
> + Sort Key: p.i
> + -> Nested Loop
> + -> Partial HashAggregate
> + Group Key: c1.parent
> + -> Seq Scan on agg_pushdown_child1 c1
> + -> Index Scan using agg_pushdown_parent_pkey on ...
> + Index Cond: (i = c1.parent)
> +(10 rows)
>
> This seems somewhat strange - maybe the plan is correct, but the extra
> sort seems unnecessary.
>
> However, maybe I'm confused/missing something? The above message says
> v17 having parts 0001-0003, but there's only one patch in v18. So maybe
> I failed to apply some prior patch?

I've rebased the last version I had on my workstation (v17), the regression
tests just worked. Maybe v18 was messed up. v20 is attached.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

Attachment Content-Type Size
v20-0001-Introduce-RelInfoList-structure.patch text/x-diff 12.8 KB
v20-0002-Aggregate-push-down-basic-functionality.patch text/x-diff 115.3 KB
v20-0003-Use-also-partial-paths-as-the-input-for-grouped-path.patch text/x-diff 18.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2022-11-04 14:17:18 Re: Schema variables - new implementation for Postgres 15
Previous Message Julien Rouhaud 2022-11-04 14:17:13 Re: Schema variables - new implementation for Postgres 15