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 1sjVzU-001P6Z-SE for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 03:38:33 +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 1sjVzS-00E01a-Ut for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 03:38:31 +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 1sjVzS-00E01Q-Jl for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 03:38:31 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sjVzL-0021Kk-BV for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 03:38:30 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-53343bf5eddso206467e87.1 for ; Wed, 28 Aug 2024 20:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724902703; x=1725507503; 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=Ey5yuZgUJKoMlRn0QH2RLyVgHOeT6qxsCjuV32FJef0=; b=cVHSn796nsvuJMEx56mOEqx2OhusJ0oS3tpGYpb0VcalWdzl/1cCGsGYzjGGDpLVZS cEJ0VbZZrZ9bXdpgGwAxM8V5Wm+zBJcfOScNuaOslMQwIPiEXOCuELnd1comyC7YHewk 0kt5VThmk0aIrya62purp6wT9/EwJ10h/XWDi91eOXVOF5HfC531/tiZSWmiZM0o2qw2 6KC628ZlD45N7EfsO3ex/tT6ocD1Pf8fk3ObYdkyraFcz+0y6p2Lum9Xf8vySpGWBy2/ 65IqGKE261pPeOjBsrb2zh1j8AdUMuHKg2yNGNKNY9u358cZN3vnT7Xcl/nRU46kWQHw svqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724902703; x=1725507503; 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=Ey5yuZgUJKoMlRn0QH2RLyVgHOeT6qxsCjuV32FJef0=; b=iB1PRdoYAg3rAphiIMdxcZsZa9cSig2USMbtNOg1+IGictpAhdWbztNt1oNqI6gPKh wXnzEt7SZ76U3vJdr0w/PdIlFR/fmnIKhnfDCEF23tPMyxKSCs0JZXbIiaH2eUcCVGWq njF02qBsdYDxOsg8zGhtKS6zmToZyqLlNeiR56TCIHtlk0HX6YmQKdz6305RHPtmsv6+ 12EBJlKyZ4LC7zVddFYXTAxrKfb7+uY9EtINnIFINxBYXRzyQ/t6mRMraQrpqBifvbog AYP1J7/TEM6CzMSMhUWSl0KOuOIH0Hv6ELeQniIKm80pzmbITNyCALB3J6RGiJ5S6cKn pw3g== X-Forwarded-Encrypted: i=1; AJvYcCV/APTh4LwZwwD8HNSPGwRlg09hMoRp5GEIny/Z89RLpFqqoJvaHzCH9MZa/QewAxP3BirKk2hbkFb3YcTu@lists.postgresql.org X-Gm-Message-State: AOJu0YxC//RihpXb8WK7GZ5oakZ0R5VJPZhFSzoEYGS4l7xitrGQL48x GFm1wQ364RhdovXoObSvidDCvBcls1aRrQ5mO4oAHXQR/iYCALvcDcuQRCmadzLCWK2icXM5zKL 7XQ21sOj2mhkmzQOvevZPyD42hjs= X-Google-Smtp-Source: AGHT+IGM2S5e9TE+xMkBtMIvDISLe9tmkM4Sb2hCKq2Uo8rvnjVTkuLCxvPZ2zxB/Ad/Jb1ap13CuuYDzUN0X/iMGiY= X-Received: by 2002:a05:6512:68b:b0:530:ad9f:8757 with SMTP id 2adb3069b0e04-5353e5aca97mr716740e87.45.1724902702530; Wed, 28 Aug 2024 20:38:22 -0700 (PDT) MIME-Version: 1.0 References: <87il22cj51.fsf@163.com> In-Reply-To: From: Tender Wang Date: Thu, 29 Aug 2024 11:38:11 +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="000000000000db483d0620ca3497" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000db483d0620ca3497 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? > > I upload EXPLAIN(COSTS ON, ANALYZE) test to [1]. I ran the same query three times, and I chose the third time result. You can check 19_off_explain.out and 19_on_explain.out. [1] https://github.com/tenderwg/eager_agg --=20 Tender Wang --000000000000db483d0620ca3497 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?

I up= load EXPLAIN(COSTS ON, ANALYZE) test to [1].
I ran the same query= three times, and I chose the third time result.
You can check 19= _off_explain.out and 19_on_explain.out.


=


=
--
Tender Wang
--000000000000db483d0620ca3497--