Compare tree structure, level cost, and range-scan growth to see what controls index performance.
Parameters
Rows N
rows
Rows in the table or index.
Fanout f
-
Child pointers per index page.
Page read
ms
Representative page read time.
Selectivity
%
Fraction of rows matched by the predicate.
Results
—
B-tree height
—
Point lookup cost
—
Matched rows
—
Range scan cost
B-tree level sketch
Point lookup cost
Range scan cost
Model and equations
$$h=\lceil\log_f N\rceil$$
B-tree height scales logarithmically with row count N and fanout f. Point lookup is height dominated, while range scans also depend on matched rows and page locality.
How to read it
The tree view shows height falling as fanout increases.
The cost plot links page-read time directly to latency.
The range plot shows leaf scanning dominating at higher selectivity.
Learn Database Index Btree Cost by dialogue
🙋
When reading Database Index Btree Cost, where should I look first? Moving Rows N changes both the plots and the result cards.
🎓
Start with B-tree height, but do not treat the number as the whole answer. Use B-tree level sketch to confirm the assumed state, then read Point lookup cost for the distribution or trend. The tree view shows height falling as fanout increases.
🙋
I can see why Rows N changes B-tree height. How should I judge the influence of Fanout f?
🎓
Move Fanout f in small steps and watch Point lookup cost. That reveals which term is controlling the result. B-tree height scales logarithmically with row count N and fanout f. Point lookup is height dominated, while range scans also depend on matched rows and page locality. A single operating point is not enough; sweep the realistic scatter range.
🙋
What is Range scan cost for? It feels like the ordinary curve already tells the story.
🎓
Range scan cost is for finding boundaries where the condition becomes risky or margin collapses quickly. The cost plot links page-read time directly to latency. In Early database-index sizing, the important question is often what happens after a small change, not only the nominal value.
🙋
So if B-tree height is within the target, can I accept the condition?
🎓
Treat this as a first-pass review. It helps with Comparing storage or cache assumptions and Separating point-query and range-query bottlenecks, but final decisions still need standards, measured data, detailed analysis, and vendor limits. The range plot shows leaf scanning dominating at higher selectivity.
Practical use
Early database-index sizing.
Comparing storage or cache assumptions.
Separating point-query and range-query bottlenecks.
FAQ
Start with B-tree height and Point lookup cost. Then use B-tree level sketch to confirm the assumed state and Point lookup cost to read distribution or bias. The tree view shows height falling as fanout increases
Move Rows N alone, then move Fanout f by a comparable amount and compare the change in B-tree height. Range scan cost shows combinations where margin or performance changes quickly.
Use it for Early database-index sizing. Instead of trusting a single point, widen the input range and check whether B-tree height keeps enough margin before moving to detailed analysis.
B-tree height scales logarithmically with row count N and fanout f. Point lookup is height dominated, while range scans also depend on matched rows and page locality. Final decisions still require standards, measured data, detailed analysis, and vendor limits.