Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
On Sat, Jun 23, 2007 at 05:58:51PM +0200, cluster wrote: > >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. > > OK, its beginning to make sense. So the fan-out is given by the key size > and each child no

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > On Fri, Jun 22, 2007 at 09:32:30PM +0200, cluster wrote: >> 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. src/in

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread cluster
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. OK, its beginning to make sense. So the fan-out is given by the key size and each child node is stored in its own page. Is that correct? Thanks in advance!

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
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

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread cluster
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 node

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
On Fri, Jun 22, 2007 at 09:32:30PM +0200, cluster wrote: > What is the fan-out (number of child nodes) on each B-tree node in > postgresql? Is it dependent of the size of the keys being indexed? If > so: How? In postgres, everything is done in pages, so how ever many keys fit in a page. Bigs keys

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread cluster
I doubt this is in the documentation, but you can always read the source. I'd take a look around: > src/backend/access/nbtree/ Maybe its just me that is blind, but I couldn't find anything on this particular issue there. :-( Any other suggestions? ---(end of broadcas

Re: [GENERAL] B-tree fan-out

2007-06-22 Thread Michael Glaesemann
On Jun 22, 2007, at 14:11 , cluster wrote: What is the fan-out (number of child nodes) on each B-tree node in postgresql? Is it dependent of the size of the keys being indexed? If so: How? In B-trees all non-leaf nodes have a bunch of pointers to its child nodes. What is the size of such

[GENERAL] B-tree fan-out

2007-06-22 Thread cluster
What is the fan-out (number of child nodes) on each B-tree node in postgresql? Is it dependent of the size of the keys being indexed? If so: How? In B-trees all non-leaf nodes have a bunch of pointers to its child nodes. What is the size of such a pointer? Thanks ---(en

[GENERAL] B-tree fan-out

2007-06-22 Thread cluster
What is the fan-out (number of child nodes) on each B-tree node in postgresql? Is it dependent of the size of the keys being indexed? If so: How? In B-trees all non-leaf nodes have a bunch of pointers to its child nodes. What is the size of such a pointer? Thanks --