Re: B-tree fan-out - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: B-tree fan-out
Date
Msg-id 20070623152702.GC11248@svana.org
Whole thread Raw
In response to Re: B-tree fan-out  (cluster <skrald@amossen.dk>)
Responses Re: B-tree fan-out  (cluster <skrald@amossen.dk>)
List pgsql-general
On Sat, Jun 23, 2007 at 04:11:52PM +0200, cluster wrote:
>
> >In postgres, everything is done in pages, so how ever many keys fit in
> >a page. Bigs keys mean less. For integers you can fit an awful lot of
> >keys.
> OK, interesting. Does that mean, that when a node containing only small
> values (e.g. integers) is split, then it gets an awful lot of child nodes?

No, when you split a page it gets split in two, with each page getting
half the keys of the old one. This is independant of the size of the
keys. (This is also why a key is limited to 1/3 page size, so you can
always split a page into two smaller ones.)

In any case, I think the answer to your original question is that the
fan-out can be up to several hundred per level, but it's not fixed.

> >>In B-trees all non-leaf nodes have a bunch of pointers to its child
> >>nodes. What is the size of such a pointer?
> >I imagine it's a page number, probably just a 32-bit integer.
> >
> OK, thanks a lot. Do you know if other database systems implement
> b-trees this way too? I.e. one page per node.

No idea whatsoever.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: cluster
Date:
Subject: Re: B-tree fan-out
Next
From: cluster
Date:
Subject: Re: B-tree fan-out