pgsql: Refactor btvacuumpage().

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: Refactor btvacuumpage().
Дата
Msg-id E1jUzJX-0006Ep-Pn@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Refactor btvacuumpage().

Remove one of the arguments to btvacuumpage(), and give up on the idea
that it's a recursive function.  We now use the term "backtracking" to
refer to the case where an earlier block must be visited to make sure no
tuples that need to be removed were missed.

Advertising btvacuumpage() as a recursive function was unhelpful.  In
reality the function always simulates recursion with a loop (it doesn't
actually call itself).  This wasn't just necessary as a precaution (per
the comments mentioning tail recursion), though.  There is no reliable
natural limit on the number of times we can backtrack.

There are important behavioral difference when "recursing"/backtracking,
mostly related to page deletion.  We don't perform page deletion when
backtracking due to the extra complexity.  And when we recurse, we're
not performing a physical order scan anymore, so we expect fairly
different conditions to hold for the page.  Structuring the code like
this makes it clearer how _bt_pagedel() cooperates with btvacuumpage()
and btvacuumscan() (as established in commit b0229f26 and commit
73a076b0).

Author: Peter Geoghegan
Reviewed-By: Masahiko Sawada
Discussion: https://postgr.es/m/CAH2-WzmRGMDWiLMcb+zagG9652PboNN4Gfcq1Gc_wJL6A716MA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9dc72514179d85e81ea594130ff0eb655188f225

Modified Files
--------------
src/backend/access/nbtree/nbtinsert.c |   3 +
src/backend/access/nbtree/nbtree.c    | 147 ++++++++++++++++++++--------------
2 files changed, 92 insertions(+), 58 deletions(-)


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: pgsql: Fix GSS client to non-GSS server connection
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Add missing newlines in error messages