From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove unnecessary PageIsEmpty() nbtree build check.
Date: Mon, 06 Jul 2020 20:49:08 +0000
Message-ID: <E1jsY32-0005Zl-7b@gemulon.postgresql.org> (raw)
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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: pg@bowt.ie
Subject: Re: pgsql: Remove unnecessary PageIsEmpty() nbtree build check.
In-Reply-To: <E1jsY32-0005Zl-7b@gemulon.postgresql.org>
References: <E1jsY32-0005Zl-7b@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox