Re: Missing docs for new enable_group_by_reordering GUC

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing docs for new enable_group_by_reordering GUC
Date: 2024-06-18 12:45:25
Message-ID: CALT9ZEHib5QvfqPQyQ=qzuk7JNY+dkQj+x6LLZ0Ja09b5R4SMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Alexander!

On Tue, 18 Jun 2024 at 16:13, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
wrote:

> On Tue, Jun 18, 2024 at 9:14 AM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
> > On 6/18/24 09:32, Bruce Momjian wrote:
> > > This commit added enable_group_by_reordering:
> > >
> > > commit 0452b461bc4
> > > Author: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
> > > Date: Sun Jan 21 22:21:36 2024 +0200
> > > It mentions it was added as a GUC to postgresql.conf, but I see no SGML
> > > docs for this new GUC value. Would someone please add docs for this?
> > > Thanks.
> > It is my mistake, sorry for that. See the patch in attachment.
>
> Bruce, thank for noticing. Andrei, thank you for providing a fix.
> Please, check the revised patch.
>
I briefly looked into this docs patch. Planner gucs are arranged
alphabetically, so enable_group_by_reordering is better to come after
enable-gathermerge not before.

+ Enables or disables the reordering of keys in a
+ <literal>GROUP BY</literal> clause to match the ordering keys of a
+ child node of the plan, such as an index scan. When turned off,
keys
+ in a <literal>GROUP BY</literal> clause are only reordered to match
+ the <literal>ORDER BY</literal> clause, if any. The default is
+ <literal>on</literal>.
I'd also suggest the same style as already exists
for enable_presorted_aggregate guc i.e:

Controls if the query planner will produce a plan which will provide
<literal>GROUP BY</literal> keys presorted in the order of keys of a child
node of the plan, such as an index scan. When disabled, the query planner
will produce a plan with <literal>GROUP BY</literal> keys only reordered to
match
the <literal>ORDER BY</literal> clause, if any. When enabled, the planner
will try to produce a more efficient plan. The default value is on.

Regards,
Pavel Borisov
Supabase

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-06-18 13:11:33 Re: tls 1.3: sending multiple tickets
Previous Message Melanie Plageman 2024-06-18 12:42:39 Re: Separate HEAP WAL replay logic into its own file