liveBook · Manning

Branching factor

As explained in Just Use Postgres!

A branching factor is the average number of child entries or nodes associated with each branch in a tree structure.

A branching factor is the average number of entries stored in each branch node of a tree. In a B-tree index, it helps determine how quickly a search reaches the leaf containing a table reference. section 4.1

Estimating index lookups

For an index with 100 entries and branching factor 3, the search requires up to O(log₃100) = 4 index lookups. Each lookup visits one index node on the path from the root toward the matching leaf. section 4.1

Figure 4.1 A sample B-tree index showing the search path to the index entry with ID = 5

Trace the search path for ID = 5 through the root, branch nodes, and linked leaf nodes of a sample B-tree index. section 4.1

How Just Use Postgres! covers it

How deep it goes
Defines branching factor and works through logarithmic lookup cost, without developing deeper tree mathematics.
Examples
Uses a B-tree search for ID = 5 and calculates four lookups for 100 entries with branching factor three.
What it assumes
Assumes familiarity with tree nodes and database indexes while defining branching factor directly.
What you can do after
Evaluate approximate B-tree index lookup counts from entry totals and branching factor.
How it connects
Connects branching factor with B-tree indexes, logarithmic complexity, leaf nodes, range queries, and ordered data retrieval.

Also explained in

Compare how 4 books explain branching factor →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Just Use Postgres!. The section links point to the parts of the book it draws on.