pgsql: Tidy up join_search_one_level code

Поиск
Список
Период
Сортировка
От David Rowley
Тема pgsql: Tidy up join_search_one_level code
Дата
Msg-id E1qSaRW-000hAI-QH@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Tidy up join_search_one_level code

The code in join_search_one_level was a bit convoluted.  With a casual
glance, you might think that other_rels_list was being set to something
other than joinrels[1] when level == 2, however, joinrels[level - 1] is
joinrels[1] when level == 2, so nothing special needs to happen to set
other_rels_list.  Let's clean that up to avoid confusing anyone.

In passing, we may as well modernize the loop in
make_rels_by_clause_joins() and instead of passing in the ListCell to
start looping from, let's just pass in the index where to start from and
make use of for_each_from().  Ever since 1cff1b95a, Lists are arrays
under the hood. lnext() and list_head() both seem a little too linked-list
like.

Author: Alex Hsieh, David Rowley, Richard Guo
Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/CANWNU8x9P9aCXGF%3DaT-A_8mLTAT0LkcZ_ySYrGbcuHzMQw2-1g%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6c00d2c9d4c533dad4e0afe28cfde0e12e4eb4e0

Modified Files
--------------
src/backend/optimizer/path/joinrels.c | 55 ++++++++++++-----------------------
1 file changed, 18 insertions(+), 37 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Release notes for 15.4, 14.9, 13.12, 12.16, 11.21.
Следующее
От: David Rowley
Дата:
Сообщение: pgsql: Fix misleading comment in paraminfo_get_equal_hashops