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 1slh0h-000cib-Ud for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Sep 2024 03:48:48 +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 1slh0g-003UJC-HW for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Sep 2024 03:48:46 +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 1slh0g-003UJ3-6T for pgsql-hackers@lists.postgresql.org; Wed, 04 Sep 2024 03:48:46 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1slh0e-0003Te-CS for pgsql-hackers@lists.postgresql.org; Wed, 04 Sep 2024 03:48:46 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a7a9cf7d3f3so35650366b.1 for ; Tue, 03 Sep 2024 20:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725421723; x=1726026523; darn=lists.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=fOrMgkk09YIEzIX4f4RsRb7e3FrWP14EArv3sihzInc=; b=eoH1GqG5i7gLajQ7zwKAtLwZuDQKEO6lS/wRB4kBtwV0FAkWabdEQfETQiQFkA35tX AcOtXYBXiSSN/6HVaSO+0Nh367Mt33p/pSVVlI9IFk17fHk1IyWYmgHaAa7ikJSyTp3P Pk9mjLszE4NLIpQOguEXMNpkD/z4Yx/yfUX/vY2IPBis4697Ds0hA3IuRP91WsMzTMyG cKY0Xh83U3WDTOuhweCMeYoZHy534I/nMeCHWKeKDDr4rKYYFu8VQY4ugPuFZNGifLgI QCav2Kt15a0P3vQB6LJNeaGsljY3PexLSPbEWbTk97Xwuz+7mkjGEgwNs2PBXf25ceC6 OASA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725421723; x=1726026523; 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=fOrMgkk09YIEzIX4f4RsRb7e3FrWP14EArv3sihzInc=; b=q3wAI60R04UJCl6jGzaOdcTY0vAoUG0NT9KabcH2Vpf9BJ/q02y5yEO2u6lYgd5f5q ef6n57/j4XUuGsTNZ+jyq6si8/5rH0WTSNiiIXBT/bF6S/quz8jCNAKAFdmpZtGe/IoN NgYq+yKUttawuNbz+eVrzxngFmBcOo0cnumLRDDEDOwx9OaZ3IYeYffVw2CqRo0bFoFk 8OvgxxU5mP8Aqkx2iRex51ItmxGuRpq/+gvJk95Wo8i3C5NQvdvZwfvCEWGKaPKYyHrm YBCsBE2jY/4k+NsCbpHZJsgWRmUq8skMbH9iCW9xaRM7GPKxbX+7V83sFDq3Hazzaznr ec3g== X-Forwarded-Encrypted: i=1; AJvYcCW8kb7uyx4hmIzXWIlWeeCU5Mp3bJrobVKi4GT5WO8bBvf9aiuL1mEAQQWx6YLfm1amrx94IfXDQCE8KJbJ@lists.postgresql.org X-Gm-Message-State: AOJu0YxXOAagEfLAY155KP8c8TWoHiVxWgawiqoXIFb8M1fAgZUyxLw9 t+xMHDucxcIzq1oYZKuKyFJieeJXp3Q1rc8Qi8fBP5vp8I0B/ION76WAzrbGOOyGxIPfnk+PG7b ydcLmzIXpKws01/4A8jZDE1r2qbI= X-Google-Smtp-Source: AGHT+IGy3fKnuUhijLirJKKRH6EmiBu09YWWyeoIDNxPwLOJH8+UgWtTVVPkkpYauApxb8qKEbbsHMXo2vmHXD+kUrQ= X-Received: by 2002:a17:907:94d6:b0:a72:8d40:52b8 with SMTP id a640c23a62f3a-a8a3f0f47bdmr75307466b.3.1725421721856; Tue, 03 Sep 2024 20:48:41 -0700 (PDT) MIME-Version: 1.0 References: <87il22cj51.fsf@163.com> In-Reply-To: From: Tender Wang Date: Wed, 4 Sep 2024 11:48:30 +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="000000000000d1b0ba0621430c9b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d1b0ba0621430c9b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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". --=20 Thanks, Tender Wang --000000000000d1b0ba0621430c9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
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, 202= 4 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".
=C2=A0


--
Thank= s,
Tender Wang
--000000000000d1b0ba0621430c9b--