Plan Trees
Optimizer Deferred
Plan diagrams show mechanisms and exact counts while cost choice is deferred.
The optimizer is deferred
The diagrams show exact cardinalities and physical mechanisms. They do not choose a winning plan. Note: choosing by cost needs table statistics, which this book defers.
Mechanisms shown
The nested-loop root row count is 2 and the hash root row count is 2. Note: both diagrams expose mechanism and exact row counts.
cardinalities are exact counts on these tiny tables; choosing a plan by cost needs statistics and is deferred - no speed/perf claims; nested-loop vs hash is mechanism, not speed.
Cost needs statistics
This engine has exact tiny-table counts, but no table statistics model. Real optimizers choose among equivalent mechanisms by estimating cost from table statistics: row counts, selectivity, and histograms of how values are distributed. Those estimates are an empirical register, not an exact fact of this tiny plan tree. This book stays on the exact side: it shows mechanisms and recomputed cardinalities, but it does not model real data distributions or engine assumptions. That boundary is the honest stopping point. Note: cost-based choice belongs outside this book's engine surface.
Summary
Use these plans to read mechanisms and cardinalities, not to rank plans. Note: choosing by cost needs statistics and is deferred.