aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-02-20 22:48:58 +1300
committerDavid Rowley <drowley@postgresql.org>2023-02-20 22:48:58 +1300
commit94cad7a3e6040e23d51b9d4869fc20e3e56ddbf7 (patch)
tree9254e4f6c6ca543988e9f243ca5aac17498ce2b0 /src/backend/executor/nodeModifyTable.c
parent67731974644ce77129d282434065c3f0be04be92 (diff)
downloadpostgresql-94cad7a3e6040e23d51b9d4869fc20e3e56ddbf7.tar.gz
postgresql-94cad7a3e6040e23d51b9d4869fc20e3e56ddbf7.zip
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
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions