Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sp12j-00FeqW-Vh for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Sep 2024 07:48:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sp12j-00Eufg-6E for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Sep 2024 07:48:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sp12i-00EufY-R0 for pgsql-hackers@lists.postgresql.org; Fri, 13 Sep 2024 07:48:36 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sp12f-000wz0-QS for pgsql-hackers@postgresql.org; Fri, 13 Sep 2024 07:48:36 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53568ffc525so2312319e87.0 for ; Fri, 13 Sep 2024 00:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726213713; x=1726818513; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BjIqae7GPmDlJPjydDZFvh+mVouQNRgJbkI0W19I2IA=; b=EB8mdLDZppkF7qEH9WEvPrr0d2ge5DsCYQcJIqokNqCHVSaY8YW14b2Rl0FXmWcHxu eGvfCsICsanJi4Rgcj0btCchCNgqOKoGgjC9KNqitq2aJRT+U/hsaj2MMORHizMPW94R p45r/4Rxle1oce6Z7QHF/UMZLXKEhxWVfc0Cfz6VAmuEIeZgMCt+VGmTL9J7F/Lc83Jt 6U8sQGwclIJDD+/pOaDlCfkpYMobv9UAUiz0PyoL41he4js7ZIhstGi/ti/5qIpJ9j2w eKZK21jiVzrXMBgW0awpK960XUd5a3Di/ruHq5dvS9waJa34ptK2afmTedmMPf0o3E1Q qhCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726213713; x=1726818513; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BjIqae7GPmDlJPjydDZFvh+mVouQNRgJbkI0W19I2IA=; b=IYiHTEFiNMAZLVwlDH7ag/mfj7fMGJCpYLkVHFXjF+P2pYnJY9907zOxfbfNmT0fQR nW+6Ql82WWBrQBum9fcbYC08LvGWYD9i0ENguXuEgAJPIChiFBOUHX07h4OvSwzBmw9U N3mpApB685Ht1bZmo0FxCx2ccIh5RJLDMcO1bzzFWmw1J8pqcGQS9bcOjJ1C+Y2QeSot I0DBj/gQxdOQjMMHI68sCX+399KT3B/oeGKs71oM4Xm+saD0XawWy6PuuPaWrT6l6KzG YLQueKNVL5yqIIVqGgkEDEIGJKH8ZgnVB4o7COI3VuJL5VlmBAgsx7teEnbR28LT+yuj 3Gog== X-Forwarded-Encrypted: i=1; AJvYcCV6f4EyhTtqtaLL8XfgQu7AafPeq4FdQyL/AUsX7OWdy1F1Q9VCMFmGV8bGZFscRJ43u5RbwxGWzqgankun@postgresql.org X-Gm-Message-State: AOJu0Yzac0G4o6g8fFIn2LPd5A28QYTcHfkijtTRvCWIiU1NtD1M9iZy ON9nS2JWKwa0miVGo93KTQYP/4jKh3K4gA0Vufo1E3watXnX6viOLgPfNgh82fji0374LjyATwH 0eclyu9dcCdMD2LXEyy9c5+RB1h4= X-Google-Smtp-Source: AGHT+IENf5plBJ6UV6b71vaF3zS2Dtj6iJ1WPhMyMuxEFAD4obt9qNXD5ui9sEYteXzH/ZGuqw4DnuchYQjxhjePGZk= X-Received: by 2002:a05:6512:104b:b0:535:6cf6:92f7 with SMTP id 2adb3069b0e04-53678ff48camr3330270e87.59.1726213712174; Fri, 13 Sep 2024 00:48:32 -0700 (PDT) MIME-Version: 1.0 References: <87il22cj51.fsf@163.com> In-Reply-To: From: Tender Wang Date: Fri, 13 Sep 2024 15:48:20 +0800 Message-ID: Subject: Re: Eager aggregation, take 3 To: Richard Guo Cc: Paul George , Andy Fan , PostgreSQL-development , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000001eebbb0621fb73aa" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001eebbb0621fb73aa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Tender Wang =E4=BA=8E2024=E5=B9=B49=E6=9C=884=E6=97=A5= =E5=91=A8=E4=B8=89 11:48=E5=86=99=E9=81=93=EF=BC=9A > > > Richard Guo =E4=BA=8E2024=E5=B9=B48=E6=9C=8821= =E6=97=A5=E5=91=A8=E4=B8=89 15:11=E5=86=99=E9=81=93=EF=BC=9A > >> On Fri, Aug 16, 2024 at 4:14=E2=80=AFPM Richard Guo >> wrote: >> > I had a self-review of this patchset and made some refactoring, >> > especially to the function that creates the RelAggInfo structure for a >> > given relation. While there were no major changes, the code should >> > now be simpler. >> >> I found a bug in v10 patchset: when we generate the GROUP BY clauses >> for the partial aggregation that is pushed down to a non-aggregated >> relation, we may produce a clause with a tleSortGroupRef that >> duplicates one already present in the query's groupClause, which would >> cause problems. >> >> Attached is the updated version of the patchset that fixes this bug >> and includes further code refactoring. >> > > The v11-0002 git am failed on HEAD(6c2b5edecc). > > tender@iZ2ze6la2dizi7df9q3xheZ:/workspace/postgres$ git am > v11-0002-Implement-Eager-Aggregation.patch > Applying: Implement Eager Aggregation > error: patch failed: src/test/regress/parallel_schedule:119 > error: src/test/regress/parallel_schedule: patch does not apply > Patch failed at 0001 Implement Eager Aggregation > hint: Use 'git am --show-current-patch=3Ddiff' to see the failed patch > When you have resolved this problem, run "git am --continue". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am --abort". > > Since MERGE/SPLIT partition has been reverted, the tests *partition_merge* and *partition_split* should be removed from parallel_schedule. After doing the above, the 0002 patch can be applied. --=20 Thanks, Tender Wang --0000000000001eebbb0621fb73aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
Tender Wang <tndrwang@gmail.com> =E4=BA=8E2024=E5=B9=B49=E6=9C= =884=E6=97=A5=E5=91=A8=E4=B8=89 11:48=E5=86=99=E9=81=93=EF=BC=9A
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">


Richard Guo <guofenglinux@gmail.com> =E4=BA=8E2024=E5=B9=B48=E6=9C= =8821=E6=97=A5=E5=91=A8=E4=B8=89 15:11=E5=86=99=E9=81=93=EF=BC=9A
=
On Fri, Aug 16, 2024 at 4= :14=E2=80=AFPM Richard Guo <guofenglinux@gmail.com> wrote:
> I had a self-review of this patchset and made some refactoring,
> especially to the function that creates the RelAggInfo structure for a=
> given relation.=C2=A0 While there were no major changes, the code shou= ld
> now be simpler.

I found a bug in v10 patchset: when we generate the GROUP BY clauses
for the partial aggregation that is pushed down to a non-aggregated
relation, we may produce a clause with a tleSortGroupRef that
duplicates one already present in the query's groupClause, which would<= br> cause problems.

Attached is the updated version of the patchset that fixes this bug
and includes further code refactoring.

= The v11-0002 git am failed on HEAD(6c2b5edecc).

tender@= iZ2ze6la2dizi7df9q3xheZ:/workspace/postgres$ git am v11-0002-Implement-Eage= r-Aggregation.patch
Applying: Implement Eager Aggregation
error: patc= h failed: src/test/regress/parallel_schedule:119
error: src/test/regress= /parallel_schedule: patch does not apply
Patch failed at 0001 Implement = Eager Aggregation
hint: Use 'git am --show-current-patch=3Ddiff'= to see the failed patch
When you have resolved this problem, run "= git am --continue".
If you prefer to skip this patch, run "git= am --skip" instead.
To restore the original branch and stop p= atching, run "git am --abort".


Since MERGE/SPLIT partition has been reverte= d, the tests=C2=A0 *partition_merge* and=C2=A0 *partition_split*=C2=A0 shou= ld be removed
from parallel_schedule. After doing the above, the = 0002 patch can be applied.

--
<= div dir=3D"ltr">
Thanks,
Tender Wang
--0000000000001eebbb0621fb73aa--