Intermediate row counts show how data changes through the plan.

highlighted = computed this step

Intermediate counts explain shape

A plan tree exposes row counts before the final result. A filter can reduce one input, and a join can emit more rows than that filtered input when one key matches more than once. Note: the growth is visible in the rendered row counts.

intermediate cardinalities\text{intermediate cardinalities}

Input counts

The filtered left input has row count 2 and the right input has row count 3. Note: these are child-node counts.

left=2,right=3\text{left}=2,\quad \text{right}=3

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.

Intermediate cardinalities nested loop join rows 3 filter sid neq s3 rows 2 scan Students rows 3 scan Enroll rows 3 result sid name course s1 Ann DB s1 Ann OS s2 Bo DB

Join count

The join output row count is 3. Note: one matching input row can contribute multiple joined rows.

join rows=3\text{join rows}=3

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.

Intermediate cardinalities nested loop join rows 3 filter sid neq s3 rows 2 scan Students rows 3 scan Enroll rows 3 result sid name course s1 Ann DB s1 Ann OS s2 Bo DB

Summary

Intermediate cardinalities are exact facts of this tiny execution. Note: choosing by cost needs statistics and is deferred.

cardinality flow\text{cardinality flow}