Re: Reordering DISTINCT keys to match input path's pathkeys - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: Reordering DISTINCT keys to match input path's pathkeys
Date
Msg-id 189a62747b5a89137b5ecd5105d03847c82c86f8.camel@cybertec.at
Whole thread Raw
In response to Reordering DISTINCT keys to match input path's pathkeys  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
On Tue, 2024-01-23 at 13:55 +0800, Richard Guo wrote:
> Similar to what we did to GROUP BY keys in 0452b461bc, I think we can do
> the same to DISTINCT keys, i.e. reordering DISTINCT keys to match input
> path's pathkeys, which can help reduce cost by avoiding unnecessary
> re-sort, or allowing us to use incremental-sort to save efforts.
>
> Attached is a patch for this optimization.  Any thoughts?

I didn't scrutinize the code, but that sounds like a fine optimization.

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum
Next
From: Bertrand Drouvot
Date:
Subject: Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed