git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: f7f70d5) | patch
Remove unnecessary PageIsEmpty() nbtree build check.
Mon, 6 Jul 2020 20:47:29 +0000 (13:47 -0700)
Mon, 6 Jul 2020 20:47:29 +0000 (13:47 -0700)
commit 28c16f4947df0a98c124ec1724faff629d6c77f7
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.
src/backend/access/nbtree/nbtsort.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /