Re: Improve list manipulation in several places

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Richard Guo <guofenglinux@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, David Rowley <dgrowleyml@gmail.com>, Ranier Vilela <ranier.vf@gmail.com>
Date: 2023-07-03T09:41:07Z
Lists: pgsql-hackers
On 09.05.23 05:13, Richard Guo wrote:
> 
> On Tue, May 9, 2023 at 1:26 AM Alvaro Herrera <alvherre@alvh.no-ip.org 
> <mailto:alvherre@alvh.no-ip.org>> wrote:
> 
>     The problem I see is that each of these new functions has a single
>     caller, and the only one that looks like it could have a performance
>     advantage is list_copy_move_nth_to_head() (which is the weirdest of the
>     lot).  I'm inclined not to have any of these single-use functions unless
>     a performance case can be made for them.
> 
> 
> Yeah, maybe this is the reason I failed to devise a query that shows any
> performance gain.  I tried with a query which makes the 'all_pathkeys'
> in sort_inner_and_outer being length of 500 and still cannot see any
> notable performance improvements gained by list_copy_move_nth_to_head.
> Maybe the cost of other parts of planning swamps the performance gain
> here?  Now I agree that maybe 0002 is not worthwhile to do.

I have committed patch 0001.  Since you have withdrawn 0002, this closes 
the commit fest item.




Commits

  1. A minor simplification for List manipulation