aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2025-03-28 23:36:49 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2025-03-28 23:37:49 +0200
commit775a06d44c04e323158826ec256386e7211e154d (patch)
tree0fb5bd5d510deffef81b5ccc8ee8ac75a7b020e3 /src/backend/executor/nodeModifyTable.c
parent519338ace410d9b1ffb13176b8802b0307ff0531 (diff)
downloadpostgresql-775a06d44c04e323158826ec256386e7211e154d.tar.gz
postgresql-775a06d44c04e323158826ec256386e7211e154d.zip
Make group_similar_or_args() reorder clause list as little as possible
Currently, group_similar_or_args() permutes original positions of clauses independently on whether it manages to find any groups of similar clauses. While we are not providing any strict warranties on saving the original order of OR-clauses, it is preferred that the original order be modified as little as possible. This commit changes the reordering algorithm of group_similar_or_args() in the following way. We reorder each group of similar clauses so that the first item of the group stays in place, but all the other items are moved after it. So, if there are no similar clauses, the order of clauses stays the same. When there are some groups, only required reordering happens while the rest of the clauses remain in their places. Reported-by: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/3ac7c436-81e1-4191-9caf-b0dd70b51511%40gmail.com Reviewed-by: Pavel Borisov <pashkin.elfe@gmail.com> Reviewed-by: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Alena Rybakina <a.rybakina@postgrespro.ru>
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions