CalcWorldHub
Free online calculator · no signup

B-tree page fanout calculator

Estimate the number of child pointers that fit in a database index page. Enter your values below to see the result and method.

A better way to figure it out
Clear
inputs.
∑
Clear result · useful details
Free calculatorNo signup ✓

Related calculators and articles

Compare methods and explore more free tools in computer science.

Browse the full computer science category →

B-tree page fanout calculator — Page size (bytes), Key size (bytes), Child pointer size (bytes) and calculation method
B-tree page fanout calculator: inputs and calculation method.
Free calculator guide

How to use the B-tree page fanout calculator

Estimate the maximum child-pointer count of a fixed-width internal index node with one fewer separator key than pointers.

What it calculates

The output counts m child pointers and m−1 separator keys that fit after the page header. It is a storage-capacity bound, not the actual occupancy of a database index.

Inputs and units

Enter safe whole-byte sizes. Page size must exceed the nonnegative header; key and pointer widths must be positive. At least one pointer must fit.

Formula and method

m = floor((page − header + key bytes) / (key bytes + pointer bytes))

The byte constraint is m × pointer bytes + (m−1) × key bytes ≤ page − header. Solving for the largest integer m gives the displayed capacity.

Worked example

For a 16 KiB page, 32-byte keys, 8-byte child pointers, and 128-byte header, 407 pointers and 406 keys use 16,248 of the available 16,256 bytes. A 408th pointer and its extra key would require 16,288 bytes and cannot fit.

How to interpret the result

The primary result is child-pointer capacity; the details show separator keys, bytes used, and unused bytes. A capacity of one cannot provide a branching internal node.

Assumptions and limitations

This model assumes m child pointers and m−1 fixed-width separator keys. It excludes slot directories, alignment, variable-length cells, record pointers, metadata beyond the entered header, and fill factor. Leaf layouts and engine-specific overhead need a different model.

Frequently asked questions

How does the page-capacity estimate divide the available bytes?

After the header, m pointers and m−1 keys must fit. The largest integer m is floor((page − header + key bytes)/(key bytes + pointer bytes)).

Does this estimate count internal-node child pointers?

Yes. The model is an internal index node with m child pointers and m−1 separator keys, excluding engine-specific overhead. It does not model a leaf page.

How do I use the B-tree page fanout calculator?

Enter Page size (bytes), Key size (bytes), Child pointer size (bytes), Page header size (bytes). Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of B-tree page fanout?

For a 16 KiB page, 32-byte keys, 8-byte child pointers, and 128-byte header, 407 pointers and 406 keys use 16,248 of the available 16,256 bytes. A 408th pointer and its extra key would require 16,288 bytes and cannot fit.

What does the B-tree page fanout calculator calculate?

Free B-tree page fanout calculator. Estimate the number of child pointers that fit in a database index page. Review its formula, example, and assumptions.