public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tatsuro Yamada <[email protected]>
To: Richard Guo <[email protected]>
Cc: Tatsuro Yamada <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: [email protected] <[email protected]>
Subject: RE: Add enable_groupagg GUC parameter to control GroupAggregate usage
Date: Mon, 29 Jun 2026 10:02:29 +0000
Message-ID: <TY4P301MB12997F863B7B51A520E02ABC9EE82@TY4P301MB1299.JPNP301.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAMbWs48cWQ=QkwH21zhfGH2MsAFYJpskjak99N4VX2yB69k-Eg@mail.gmail.com>
References: <CAOKkKFvYHSEsFazkrf9bRH14p-H27XMaqbZfRYjS6EHBruvZMQ@mail.gmail.com>
<CAExHW5tPhCw5HpHG6F7uAXx3re_gRXqm_ryJFjFQ2+WrVY+hPQ@mail.gmail.com>
<CAOKkKFsLbbpVMCG2_bV8u7M2sXLTs0y_yfMpywKekGi+qKtWKw@mail.gmail.com>
<CAOKkKFvgjAwtUFKh3baZ7BcQ5u+wS_DO+2n7dh0un+19v_VOzQ@mail.gmail.com>
<CAApHDvqq21KL9-eCfUyAUqxEyz40dut8+ehQHJD3Rh75iEMycw@mail.gmail.com>
<CAOKkKFvBi5tNaPkP-VEUcAr=nek0nm9=sUnP+dmqCm-vmnL9DA@mail.gmail.com>
<CAMbWs4-rqGC78jHduXO_feXCFzK=gzrcSHRTkATTKChG3YGq0A@mail.gmail.com>
<TY4P301MB129931A356F6934C432BB0259EEC2@TY4P301MB1299.JPNP301.PROD.OUTLOOK.COM>
<CAMbWs48cWQ=QkwH21zhfGH2MsAFYJpskjak99N4VX2yB69k-Eg@mail.gmail.com>
Hi Richard,
> Yeah, I think so. The v4 patch actually already did that. You can
> find these changes in create_setop_path(), create_unique_path(), and
> cost_group().
Thank you for the clarification. I've reviewed the v4 patch and confirmed
that it already covers SetOp, Unique, Group, etc.
I ran make installcheck in my environment and all tests passed without
errors.
Since the enable_groupagg parameter also affects SetOp, Unique, and
other nodes, I've created documentation patches to clarify this. I'm attaching
them to this email. They apply on top of your v4 patch.
- 0001 patch: This improves the documentation for the enable_groupagg
parameter so that users can more easily understand which operations it
affects. If you agree with the changes, I'd like to post an updated patch
that integrates this into v4.
- 0002 patch: This provides a similar improvement for the enable_hashagg
parameter documentation. Since it concerns enable_hashagg, I'm happy
to move this to a separate thread if you prefer.
Best Regards,
Tatsuro Yamada
> -----Original Message-----
> From: Richard Guo <[email protected]>
> Sent: Friday, June 26, 2026 3:26 PM
> To: Tatsuro Yamada(山田達朗) <[email protected]>
> Cc: Tatsuro Yamada <[email protected]>; David Rowley
> <[email protected]>; Ashutosh Bapat
> <[email protected]>; [email protected]
> Subject: Re: Add enable_groupagg GUC parameter to control
> GroupAggregate usage
>
> On Thu, Jun 25, 2026 at 6:12 PM Tatsuro Yamada <[email protected]>
> wrote:
> > It sounds like there are several plan nodes that could be covered by this
> GUC
> > (such as SetOp, sort-based Unique for DISTINCT, semijoin uniqueification,
> > and Group nodes). Do you think we should cover all of them before the
> patch
> > would be considered complete enough for commit?
>
> Yeah, I think so. The v4 patch actually already did that. You can
> find these changes in create_setop_path(), create_unique_path(), and
> cost_group().
>
> > I'd be interested to hear your thoughts on how best to proceed, and
> whether
> > dividing the work into smaller pieces would make sense.
>
> It seems that the scope of the regression test changes isn't too
> large, so I think keeping them in one patch is fine.
>
> - Richard
Attachments:
[application/octet-stream] 0001-doc-Clarify-enable_groupagg-also-covers-Unique-and-S.patch (1.2K, ../TY4P301MB12997F863B7B51A520E02ABC9EE82@TY4P301MB1299.JPNP301.PROD.OUTLOOK.COM/2-0001-doc-Clarify-enable_groupagg-also-covers-Unique-and-S.patch)
download | inline diff:
From a643d66ba152d241879a63b88dc5a5c787d6aab2 Mon Sep 17 00:00:00 2001
From: Tatsuro Yamada <[email protected]>
Date: Mon, 29 Jun 2026 14:02:48 +0900
Subject: [PATCH 1/2] doc: Clarify enable_groupagg also covers Unique and SetOp
plans
The parameter description mentioned only sort-based grouping and
aggregation plan types, but it also discourages sort-based Unique
and SetOp plans. Mention them explicitly so users know the full
scope of the switch.
---
doc/src/sgml/config.sgml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a80df44786e..435730b5ac2 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -5870,7 +5870,8 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<listitem>
<para>
Enables or disables the query planner's use of sort-based grouping
- and aggregation plan types. The default is <literal>on</literal>.
+ and aggregation plan types. This also covers sort-based <literal>Unique</literal> and
+ <literal>SetOp</literal> plans. The default is <literal>on</literal>.
</para>
</listitem>
</varlistentry>
--
2.47.3
[application/octet-stream] 0002-doc-Clarify-enable_hashagg-also-covers-hash-based-Se.patch (1.1K, ../TY4P301MB12997F863B7B51A520E02ABC9EE82@TY4P301MB1299.JPNP301.PROD.OUTLOOK.COM/3-0002-doc-Clarify-enable_hashagg-also-covers-hash-based-Se.patch)
download | inline diff:
From 94c72dfebc5bdc663e5243b3a8f322c22994d3b4 Mon Sep 17 00:00:00 2001
From: Tatsuro Yamada <[email protected]>
Date: Mon, 29 Jun 2026 14:16:11 +0900
Subject: [PATCH 2/2] doc: Clarify enable_hashagg also covers hash-based SetOp
plans
The parameter description mentioned only hashed aggregation plan
types without noting that it also covers hash-based SetOp plans.
Add this for consistency with the enable_groupagg description.
---
doc/src/sgml/config.sgml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 435730b5ac2..64a827cf563 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -5885,7 +5885,8 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<listitem>
<para>
Enables or disables the query planner's use of hashed
- aggregation plan types. The default is <literal>on</literal>.
+ aggregation plan types. This also covers hash-based <literal>SetOp</literal> plans.
+ The default is <literal>on</literal>.
</para>
</listitem>
</varlistentry>
--
2.47.3
view thread (18+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: RE: Add enable_groupagg GUC parameter to control GroupAggregate usage
In-Reply-To: <TY4P301MB12997F863B7B51A520E02ABC9EE82@TY4P301MB1299.JPNP301.PROD.OUTLOOK.COM>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox