Re: Importance of re-index

From: "Nicolas Barbier" <nicolas(dot)barbier(at)gmail(dot)com>
To: "Ron Johnson" <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: "pgsql general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Importance of re-index
Date: 2006-08-19 10:03:23
Message-ID: b0f3f5a10608190303u15ed197dne3db4d36f26d27c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2006/8/10, Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2006-08-19 10:38:45 Re: Query optimization and indexes
Previous Message Jim Nasby 2006-08-19 03:40:29 Re: Importance of re-index