From: | David Rowley <drowley(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix misleading comment for get_cheapest_group_keys_order |
Date: | 2022-09-19 22:04:41 |
Message-ID: | E1oaOsa-0016SK-NO@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix misleading comment for get_cheapest_group_keys_order
The header comment for get_cheapest_group_keys_order() claimed that the
output arguments were set to a newly allocated list which may be freed by
the calling function, however, this was not always true as the function
would simply leave these arguments untouched in some cases.
This tripped me up when working on 1349d2790 as I mistakenly assumed I
could perform a list_concat with the output parameters. That turned out
bad due to list_concat modifying the original input lists.
In passing, make it more clear that the number of distinct values is
important to reduce tiebreaks during sorts. Also, explain what the
n_preordered parameter means.
Backpatch-through: 15, where get_cheapest_group_keys_order was introduced.
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/1ec2d0bc68db9ddffeeaa7f8a9f79ac2620d52e1
Modified Files
--------------
src/backend/optimizer/path/pathkeys.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2022-09-19 22:11:40 | pgsql: Consistently use named parameters in regex code. |
Previous Message | David Rowley | 2022-09-19 22:03:56 | pgsql: Fix misleading comment for get_cheapest_group_keys_order |