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

From David Rowley
Subject Re: POC: GROUP BY optimization
Date
Msg-id CAApHDvoEF0GsqmBuCPXb6f12jPwz8EeLG-oYsOSc5zrJtKZHOg@mail.gmail.com
Whole thread Raw
In response to Re: POC: GROUP BY optimization  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: POC: GROUP BY optimization
List pgsql-hackers
On Wed, 13 Jul 2022 at 15:37, David Rowley <dgrowleyml@gmail.com> wrote:
> I'm just in this general area of the code again today and wondered
> about the header comment for the preprocess_groupclause() function.
>
> It says:
>
>  * In principle it might be interesting to consider other orderings of the
>  * GROUP BY elements, which could match the sort ordering of other
>  * possible plans (eg an indexscan) and thereby reduce cost.  We don't
>  * bother with that, though.  Hashed grouping will frequently win anyway.
>
> I'd say this commit makes that paragraph mostly obsolete.  It's only
> true now in the sense that we don't try orders that suit some index
> that would provide pre-sorted results for a GroupAggregate path.  The
> comment leads me to believe that we don't do anything at all to find a
> better order, and that's not true now.

I've just pushed a fix for this.

David



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Kerberos delegation support in libpq and postgres_fdw
Next
From: Andres Freund
Date:
Subject: pg_upgrade test failure