Re: Some clean-up work in get_cheapest_group_keys_order()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Subject: Re: Some clean-up work in get_cheapest_group_keys_order()
Date: 2022-07-12 23:02:02
Message-ID: 1986787.1657666922@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> * I think list_truncate(list_copy(list), n) is a pretty bad way to
> copy the first n elements of a list, especially when n is likely to be
> 0 most of the time. I think we should just add a function called
> list_copy_head(). We already have list_copy_tail().

Agreed, but I think there are other instances of that idiom that
should be cleaned up while you're at it.

> I think the first 3 are worth fixing in PG15 since all that code is
> new to that version. The 4th, I'm so sure about.

I'd say keeping v15 and v16 in sync here is worth something.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2022-07-12 23:05:58 Re: [PATCH] Log details for client certificate failures
Previous Message David Rowley 2022-07-12 22:55:07 Some clean-up work in get_cheapest_group_keys_order()