• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 825
  • Last Modified:

How many Leaf nodes can each Branch node in a b-tree index have?

How many Leaf nodes can each Branch node in a b-tree index have?
0
Mr_Shaw
Asked:
Mr_Shaw
  • 3
  • 2
  • 2
3 Solutions
 
momi_sabagCommented:
it depends on the index page size and the key size
you can find calculations that give a result for such a question but it is a bit different for every database
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
In theory:
sizeof(page) / (sizeof(key) + sizeof(row address))
However, there might be a compression (removing "common" leading parts of the key for all leaf references), a "keep-free" setting which enforces to page to be split, and some factors more. There is no complete answer because it is an implementation detail, as momi_sabag wrote already.
0
 
Mr_ShawAuthor Commented:
does it also depend on how much data you can squeeze into a 8k page?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
1. You can change the page size, so 8k is not always to be assumed
2. It does not depend on data, only on keys.

Exception for 2: A MSSQL Clustered Index contains the complete data, not only the keys. A Clustered Index is reorganizing the physical table data. Other index types do not, they are just additional "pointer" files, and hence only containing key data.
0
 
momi_sabagCommented:
which database are you using?
0
 
Mr_ShawAuthor Commented:
sql  2005
0
 
Mr_ShawAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now