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 1sjVkE-001N1U-U6 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 03:22:47 +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 1sjVkC-00Drf5-MH for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 03:22:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjVkC-00Drew-8Q for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 03:22:44 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sjVk6-001wnv-Bj for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 03:22:43 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a86910caf9cso241315266b.1 for ; Wed, 28 Aug 2024 20:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724901757; x=1725506557; 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=iRiIn4Keyt+1mBR4Bj/ntQmWYkO+7bQecb5I2Q/J5YM=; b=TLYm0APfY53zwGoWt7ZrNQX3FU2NKrLRUI/GfTrUnalO7cgBV6KpTLf2jnbyiNf3T9 l+PIb7EbWCHIdIvJpb9zK5dbQlkO6gW6OUkGAstdtMX0IjAyB2ZLsBQ9biyqcvV7VIo+ 8kT1b/82e3iklIZQjys3QqovJWGLSi07ofFUdVtRlROQ0suGEjh7q1IItewOT/jiV5oN 636t94+iA/aByV411Frup2XHLA2Bz7/u/IlclrSHp3OfRX1yMaqSTjp6L19sCiPJmeCq pYBjtqFzCE5PVkdoeEYVQS4bLy5DPZzcwuLP7uY517H2q4MtKH0FWIXK1n/U4uINJesf H38w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724901757; x=1725506557; 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=iRiIn4Keyt+1mBR4Bj/ntQmWYkO+7bQecb5I2Q/J5YM=; b=kRP2x8rm/6dNNHUuucPR9X9qwP9TZqf/yZ0vmmTn40JtrmbVgtii12cF8jVX/Us5R6 DYzreruDzslvDacoMu/1vMDZgkjDaovVG2DuyM/rmRd9saelKszm33hiquZoJsdrXWuC c5PxpLCV3ND0XGPVCJu9d1vrzOEjNfxwIug8mZ/Bt92piO0rpgG80OOB13lLD8Jh5Y14 EvVxPgTn2qjLRh1HO4rLhDhpPEiI97j4C/hH0j/0X0UYSyTcrayccgkFV0mAMiW1jxlQ ObNi9fI7QzBqFXZA10C4le/lqSReSomMGG3ZGRgI2usL7xWvpgPeb283Yo1eljWsvgGH 7dxw== X-Forwarded-Encrypted: i=1; AJvYcCXxyinqkuSlU6ILItIlovZPdNA4gqot+1a423sjk6bcG+o9qmVUFX+JCRB6yYzl2XVmOzB8ADNH8wRQsI1l@lists.postgresql.org X-Gm-Message-State: AOJu0Yz/s9SqP0FsN7oP1fIXg0KIPwOADAH6c+R4pvcqhmUlreQ9OPnx iAsUHGGeDlhxIVa5LoVgKap4mN1XIgSnLmKKQ4itlm64M3vSCo6eyAcLtVQIARDaabFy5/hYQBp xma/sInPkYBUC4zKRANg/Ukzr6jE= X-Google-Smtp-Source: AGHT+IGkoJvxIEh2+5J6PLrZpGpkIgRCmCfg0hYtI7BLriSox0C+FciHulVHUIBCcHsQipfR9HiX6CP7sS+hkv+ZL/A= X-Received: by 2002:a17:907:1b87:b0:a7a:afe8:1013 with SMTP id a640c23a62f3a-a898c36ea21mr21973866b.1.1724901756284; Wed, 28 Aug 2024 20:22:36 -0700 (PDT) MIME-Version: 1.0 References: <87il22cj51.fsf@163.com> In-Reply-To: From: Tender Wang Date: Thu, 29 Aug 2024 11:22:24 +0800 Message-ID: Subject: Re: Eager aggregation, take 3 To: Richard Guo Cc: Robert Haas , Paul George , Andy Fan , PostgreSQL-development , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000074b4260620c9fcce" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000074b4260620c9fcce Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Richard Guo =E4=BA=8E2024=E5=B9=B48=E6=9C=8829=E6= =97=A5=E5=91=A8=E5=9B=9B 10:46=E5=86=99=E9=81=93=EF=BC=9A > On Wed, Aug 28, 2024 at 9:01=E2=80=AFPM Robert Haas wrote: > > On Tue, Aug 27, 2024 at 11:57=E2=80=AFPM Tender Wang wrote: > > > I haven't look all of them. I just pick few simple plan test(e.g. > 19.sql, 45.sql). > > > For example, 19.sql, eager agg pushdown doesn't get large gain, but a > little > > > performance regress. > > > > Yeah, this is one of the things I was worried about in my previous > > reply to Richard. It would be worth Richard, or someone, probing into > > exactly why that's happening. My fear is that we just don't have good > > enough estimates to make good decisions, but there might well be > > another explanation. > > It's great that we have a query to probe into. Your guess is likely > correct: it may be caused by poor estimates. > > Tender, would you please help provide the outputs of > > EXPLAIN (COSTS ON, ANALYZE) > > on 19.sql with and without eager aggregation? > Yeah, in [1], 19_off.out and 19_on.out are the output of explain(costs off, analyze). I will do EXPLAIN(COSTS ON, ANALYZE) tests and upload them later today. [1] https://github.com/tenderwg/eager_agg --=20 Tender Wang --00000000000074b4260620c9fcce 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=8829=E6=97=A5=E5=91=A8=E5=9B=9B 10:46=E5=86=99=E9=81=93=EF=BC=9A
=
On Wed, Aug 28, 202= 4 at 9:01=E2=80=AFPM Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Aug 27, 2024 at 11:57=E2=80=AFPM Tender Wang <tndrwang@gmail.com> wrote= :
> > I haven't look all of them. I just pick few simple plan test(= e.g. 19.sql, 45.sql).
> > For example, 19.sql, eager agg pushdown doesn't get large gai= n, but a little
> > performance regress.
>
> Yeah, this is one of the things I was worried about in my previous
> reply to Richard. It would be worth Richard, or someone, probing into<= br> > exactly why that's happening. My fear is that we just don't ha= ve good
> enough estimates to make good decisions, but there might well be
> another explanation.

It's great that we have a query to probe into.=C2=A0 Your guess is like= ly
correct: it may be caused by poor estimates.

Tender, would you please help provide the outputs of

EXPLAIN (COSTS ON, ANALYZE)

on 19.sql with and without eager aggregation?

Yeah, in [1], 19_off.out and 19_on.out are the output of explain(cos= ts off, analyze).
I will do EXPLAIN(COSTS ON, ANALYZE) tests and = upload them later today.


[1]=C2=A0<= a href=3D"https://github.com/tenderwg/eager_agg">https://github.com/tenderw= g/eager_agg=C2=A0


--
Tender Wang
--00000000000074b4260620c9fcce--