Re: POC: GROUP BY optimization - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: POC: GROUP BY optimization
Date
Msg-id CAPpHfdtNnX9PYmgEsh9DXYws2Px6UJhH5kYUxsg3hu-zJTYuWw@mail.gmail.com
Whole thread Raw
In response to Re: POC: GROUP BY optimization  (Andrei Lepikhov <a.lepikhov@postgrespro.ru>)
Responses Re: POC: GROUP BY optimization  (Nathan Bossart <nathandbossart@gmail.com>)
Re: POC: GROUP BY optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi!

I've applied your changes with minor editing, thank you.

On Thu, Jan 18, 2024 at 11:49 AM Andrei Lepikhov
<a.lepikhov@postgrespro.ru> wrote:
> >> * Part of the work performed in this patch overlaps with that of
> >> preprocess_groupclause.  They are both trying to adjust the ordering of
> >> the GROUP BY keys to match ORDER BY.  I wonder if it would be better to
> >> perform this work only once.
> >
> > Andrei, could you take a look.
> As I see, the PathKeyInfo list often contains duplicated pathkeys,
> coming from either sort_pathkeys or path->pathkeys orderings. So, I can
> propose to check duplicates each time (see step2.txt in attachment).

Actually I asked to recheck if we can cut some part of
preprocess_groupclause() given that we're reordering the pathkeys
later.  It seems that we can remove everything except the work with a
grouping set.  I've done this in the revised patchset.

I'm going to push this if there are no objections.

------
Regards,
Alexander Korotkov

Attachment

pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: [PATCH] Exponential backoff for auth_delay
Next
From: Daniel Gustafsson
Date:
Subject: Re: pgsql: Clean up role created in new subscription test.