postgresql/src
David Rowley 94cad7a3e6 Optimize generate_orderedappend_paths
In generate_orderedappend_paths(), when match_partition_order_desc was
true, we would lcons() items to various lists in a loop over each live
partition.  When the number of live partitions was large, the lcons()
could show up in profiles due to it having to perform memmove() to make
way for the new list item.

Here we adjust things so that we just perform the loop over the live
partitions backwards when match_partition_order_desc is true.  This allows
us to simplify the logic in the loop.  Now, as far as the guts of the loop
knows, there's no difference between match_partition_order and
match_partition_order_desc.  We can just set match_partition_order to true
so that we build the correct list of paths for the asc and desc case. Per
idea from Andres Freund.

Discussion: https://postgr.es/m/20230217002351.nyt4y5tdzg6hugdt@awork3.anarazel.de
2023-02-20 22:48:58 +13:00
..
backend Optimize generate_orderedappend_paths 2023-02-20 22:48:58 +13:00
bin Add wait_for_replay_catchup wrapper to Cluster.pm 2023-02-13 11:52:19 +01:00
common Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
fe_utils Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
include Add MSVC support for pg_leftmost_one_pos32() and friends 2023-02-20 14:55:32 +07:00
interfaces Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates 2023-02-15 10:12:16 +09:00
makefiles Update copyright for 2023 2023-01-02 15:00:37 -05:00
pl Rename force_parallel_mode to debug_parallel_query 2023-02-15 21:21:59 +13:00
port Remove gratuitous references to postmaster program 2023-01-26 10:48:32 +01:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Print the correct aliases for DML target tables in ruleutils. 2023-02-17 16:40:34 -05:00
timezone Update time zone data files to tzdata release 2022g. 2023-01-31 17:36:55 -05:00
tools Redesign archive modules 2023-02-17 14:26:42 +09:00
tutorial Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00