Re: Some clean-up work in get_cheapest_group_keys_order()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>,
Tomas Vondra <tomas.vondra@enterprisedb.com>
Date: 2022-07-12T23:02:02Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.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
Commits
-
Use list_copy_head() instead of list_truncate(list_copy(...), ...)
- c23e3e6beb27 16.0 landed
-
Tidy up code in get_cheapest_group_keys_order()
- 44b5d5625389 15.0 landed
- 4cc832f94a58 16.0 landed