Re: B-tree index balance?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: B-tree index balance?
Date: 2024-01-19 21:36:00
Message-ID: CANzqJaCmG88ew6zBDtZWa9pGFEhq7SbD2NO5r48y37D0cYxwQQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 19, 2024 at 11:37 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Ron Johnson <ronljohnsonjr(at)gmail(dot)com> writes:
> > On an RDMS which I used in the 1990s and 2000s, b-tree indices of
> sequences
> > would get unbalanced, since every new leaf was added to the far right
> > corner of the tree.
> > Sure, they would auto-balance *to a degree* during node splits, but all
> > those "far-right corner" inserts still left them pretty lopsided.
> > Thus, they provided a utility which we could use to determine the
> > lopsidedness, and thus decide when to rebuild an index.
>
> > Does Postgresql keep b-tree indexes on sequences fully balanced? If not,
> > how do I see how unbalanced they are? (Assume PG12+.)
>
> As far as I know, we don't have a problem of that sort. Continued
> insertions will eventually force a split of the root node, which will
> rebalance the tree.
>

Thanks for the explanation.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Joseph Krogh 2024-01-20 04:08:43 Daterange question
Previous Message Tom Lane 2024-01-19 16:37:18 Re: B-tree index balance?