pgsql: Remove unnecessary PageIsEmpty() nbtree build check. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: Remove unnecessary PageIsEmpty() nbtree build check.
Date
Msg-id E1jsY32-0005Zl-7b@gemulon.postgresql.org
Whole thread Raw
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Create composite array types for initdb-created relations.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Resolve gratuitous tabs in test SQL file