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

From David Rowley
Subject Re: Reordering DISTINCT keys to match input path's pathkeys
Date
Msg-id CAApHDvq39jp0EXbtu0Kwx7um_x54MiFcKx2sNj9kdTc9TEYu7g@mail.gmail.com
Whole thread Raw
In response to Reordering DISTINCT keys to match input path's pathkeys  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Reordering DISTINCT keys to match input path's pathkeys
List pgsql-hackers
On Tue, 23 Jan 2024 at 18:56, Richard Guo <guofenglinux@gmail.com> 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.  For
> instance,

I've not caught up on the specifics of 0452b461b, but I just wanted to
highlight that there was some work done in [1] in this area.  It seems
Ankit didn't ever add that to a CF, so that might explain why it's
been lost.

Anyway, just pointing it out as there may be useful code or discussion
in the corresponding threads.

David

[1] https://postgr.es/m/da9425ae-8ff7-33d9-23b3-2a3eb605e106%40gmail.com



pgsql-hackers by date:

Previous
From: Michael Zhilin
Date:
Subject: Re: Shared detoast Datum proposal
Next
From: Ajin Cherian
Date:
Subject: Re: Synchronizing slots from primary to standby