From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: nbtree: Move fastpath NULL descent stack assertion.
Date: Wed, 11 Mar 2020 00:27:07 +0000
Message-ID: <E1jBpDH-0003LV-0a@gemulon.postgresql.org> (raw)
nbtree: Move fastpath NULL descent stack assertion.
Commit 074251db added an assertion that verified the fastpath/rightmost
page insert optimization's assumption about free space: There should
always be enough free space on the page to insert the new item without
splitting the page. Otherwise, we end up using the "concurrent root
page split" phony/fake stack path in _bt_insert_parent(). This does not
lead to incorrect behavior, but it is likely to be far slower than
simply using the regular _bt_search() path. The assertion catches
serious performance bugs that would probably take a long time to detect
any other way.
It seems much more natural to make this assertion just before the point
that we generate a fake/phony descent stack. Move the assert there.
This also makes _bt_insertonpg() a bit more readable.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/39eabec90451d8badbba9b3e938d6d05432a0517
Modified Files
--------------
src/backend/access/nbtree/nbtinsert.c | 46 +++++++++++++++--------------------
1 file changed, 20 insertions(+), 26 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: nbtree: Move fastpath NULL descent stack assertion.
In-Reply-To: <E1jBpDH-0003LV-0a@gemulon.postgresql.org>
References: <E1jBpDH-0003LV-0a@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