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@xxxxxxxxx> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
Attachment:
signature.asc
Description: Digital signature