Re: Importance of re-index - Mailing list pgsql-general

From Nicolas Barbier
Subject Re: Importance of re-index
Date
Msg-id b0f3f5a10608190303u15ed197dne3db4d36f26d27c7@mail.gmail.com
Whole thread Raw
In response to Re: Importance of re-index  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-general
2006/8/10, Ron Johnson <ron.l.johnson@cox.net>:

> How aggressively does PostgreSQL keep b-trees in balance?
>
> Inserting the range [1..10000000] should result in a right-
> unbalanced tree.

Are you talking about a tree that is unbalanced regarding its height
(ie, has some leaves that are further away from the root than others),
or regarding the space occupation within the leafs (ie, some leaves
are almost empty, while others are not)?

In the former case I think you should read up some on B+trees, since
they are by design always perfectly height-balanced. Note that the B
does not stand for "binary".

In the latter: It won't, because the splitting mechanism will never
result in an almost-empty leaf. That can only be caused by deletions.

greetings,
Nicolas

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

pgsql-general by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Importance of re-index
Next
From: Gregory Stark
Date:
Subject: Re: Query optimization and indexes