pgsql: Remove unnecessary PageIsEmpty() nbtree build check.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: Remove unnecessary PageIsEmpty() nbtree build check.
Дата
Msg-id E1jsY32-0005Zl-7b@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Remove unnecessary PageIsEmpty() nbtree build check.

nbtree index builds cannot write out an empty page.  That would mean
that there was no way to create a pivot tuple pointing to the page one
level up, since _bt_truncate() generates one based on page's firstright
tuple.

Replace the unnecessary PageIsEmpty() check with an assertion that
checks that the page has space for at least two line pointers (the
would-be high key line pointer, plus at least one valid "data item"
tuple line pointer).

The PageIsEmpty() check was added by commit 5d9f146c over 20 years ago.
It looks like it has always been unnecessary.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/28c16f4947df0a98c124ec1724faff629d6c77f7

Modified Files
--------------
src/backend/access/nbtree/nbtsort.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Create composite array types for initdb-created relations.
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Resolve gratuitous tabs in test SQL file