Plan Trees
Scan Filter Project
A scan-filter-project pipeline changes intermediate cardinalities.
Pipeline cardinalities change
A pipeline lets you read row counts from the leaves up to the root. The scan starts with the base table, the filter keeps matching rows, and project deduplicates under set semantics. Note: the rendered result table is recomputed.
Filter changes row count
The scan row count is 3 and the filter row count is 2. Note: the filter output is an intermediate result, not an authored count.
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.
Project deduplicates
The root project row count is 1. Note: projection follows set semantics here, so duplicate projected rows collapse.
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.
Summary
A pipeline exposes the exact row count after each physical step. Note: choosing by cost needs statistics and is deferred.