public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: Neil Chen <[email protected]>
To: Chao Li <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: nbtree: reduce code redundancy by using _bt_getmeta() in _bt_gettrueroot()
Date: Wed, 8 Jul 2026 00:32:21 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAA3qoJk3KxJ_aCwj1RHwFL53GEUHHu=szh_8j=3+GWE5JPcKUQ@mail.gmail.com>
References: <CAEoWx2nisjqs4iC9o4Hu7-Ab767=cMZZzmhBGb8SaQtMMmVqPQ@mail.gmail.com>
	<CAA3qoJk3KxJ_aCwj1RHwFL53GEUHHu=szh_8j=3+GWE5JPcKUQ@mail.gmail.com>

On 16/01/2026 10:09, Neil Chen wrote:
> Hi Chao,
> 
> On Thu, Jan 15, 2026 at 4:11 PM Chao Li <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> 
>     I noticed this while reviewing [1]. _bt_gettrueroot() performs the
>     same metapage checks as _bt_getmeta(), so using _bt_getmeta() here
>     removes the duplicated code.
> 
> 
> It looks good to me. These two code snippets are exactly identical,
> so removing the redundant code is reasonable.
> 
> As can be seen from the contextual comments, this is not a performance- 
> critical path either,
> so we don’t need to worry about the performance overhead caused by 
> function calls.
> 
> I also checked the changes made in commit dd299df, which essentially 
> does the same thing for the function _bt_getrootheight.

Ok, committed.

- Heikki







view thread (4+ messages)

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: nbtree: reduce code redundancy by using _bt_getmeta() in _bt_gettrueroot()
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox