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 1sjVAs-001IYt-5I for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 02:46:14 +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 1sjVAp-00DX4N-QN for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 02:46:12 +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 1sjVAp-00DX4E-Fs for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 02:46:12 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sjVAn-001waS-Kq for pgsql-hackers@postgresql.org; Thu, 29 Aug 2024 02:46:10 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-6c0ac97232bso1877077b3.1 for ; Wed, 28 Aug 2024 19:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724899569; x=1725504369; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZQWnsPfHpvNbCTzbh7w8sFGm1JDNgpuY27T1Bxu8gIM=; b=QO6KMJNyGuOu+MBSB4FoNSvIFgHrlsVvFU8zWiNJ53SvjJ5GL1U/4bXt62gBEzKqxx Rf3JWNuUxdL4Ddo5JOBV0BFwY9xT5NnMGLfxgHwLrKN22BQEkGxkjm0ZNCyzExgxZ4c1 c3fbPzGMdXcfv1k3i6rfvz7B2Zz5ghQzNnE8u2e2AhuOwS38DwgaM7Qm8/yRUfWhAUs+ 4UMoViNRobdhL4jNoPMyjr6iKKFGkqk2GcC3tBUB7Linlk19/g3v+xDUZf2IT/NzL5uY 1l+6AUC0YIaFJ+dPnrw1TIz63LKfrrC65bv6omlUEnBwGreH93IEhj6LSayfcQdFa3me 4iHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724899569; x=1725504369; h=content-transfer-encoding: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=ZQWnsPfHpvNbCTzbh7w8sFGm1JDNgpuY27T1Bxu8gIM=; b=sZqlD6aVbhtAwlNWtYLlnPrrx6xiX1xtWiEoqgnjNoEmAW3rov/nproeL1VhXANJ/K BlLXQ6qay66GyoSBDYNF/KA7dxxxS4Sm65AwNm5eTs8tVtdJsdcrTcSQqk7XTh1qmGZ5 fClBCfqixgwrfva3ivCB/T816K+a/RUUZepwDMv0GmYRbSHTk3Wui5pdeLAkWQN0b780 +1q+FLLCe2dr0S/hXH5WUhyNLA4f1m8cnPOllzYrddExB9l/8/Gf6wXW4OQY6NOrxh+7 0IMMCy4tUKDt95S3ctaEOishA+IKlAqldabyr7PORqDIfNGcFfMrx9+PMp3Ku1B8JP2e obCw== X-Forwarded-Encrypted: i=1; AJvYcCXeBVtKDL/LTS5o3oiCTffMk/JVWOUhGU9o1cv1apNqDp28xIbrJzCoFH8je8OvvYayo3VIujyjuEVMBm3F@postgresql.org X-Gm-Message-State: AOJu0YzGy27sZNxBG2WYCmUWou9ewVc2TTJ9bG8Zx3re9kTzxo19wkqu ezOr12XJitc0eN/niDT1S13wVLrwZyWHHqcE8Y7zJYZRNhOUCD84Ugf2RsC5FoEkKvrhqg8lEb9 07Onj58pSHfEg8qP3BSN8FhsmyN2Y1d5F X-Google-Smtp-Source: AGHT+IGtBTw2bIMf2nTs9TLE9U7XyauPSRg8nBx0GW18WV6O/+Te6hZzGg/h0Kp7Uhv5fnvA87NfRztOcZ83y3WaCok= X-Received: by 2002:a05:690c:6603:b0:62f:a250:632b with SMTP id 00721157ae682-6d2759683c2mr16743607b3.8.1724899568854; Wed, 28 Aug 2024 19:46:08 -0700 (PDT) MIME-Version: 1.0 References: <87il22cj51.fsf@163.com> In-Reply-To: From: Richard Guo Date: Thu, 29 Aug 2024 10:45:58 +0800 Message-ID: Subject: Re: Eager aggregation, take 3 To: Robert Haas Cc: Tender Wang , Paul George , Andy Fan , PostgreSQL-development , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.sq= l, 45.sql). > > For example, 19.sql, eager agg pushdown doesn't get large gain, but a l= ittle > > 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 will continue to do benchmark on this feature. Thanks again for running the benchmarks. Thanks Richard