Each left row gets one existence flag.

highlighted = computed this step

Existence flag per left row

Each left row gets an exists flag after the pair grid is checked.

exists per left row\text{exists per left row}

Read exists flags

3 left rows have at least one matching right row.

left rows with match=3\text{left rows with match}=3

Semi-join examples are tiny finite-table transforms; SQL dialect completeness, type coercion, optimizer behavior, execution cost, indexing, and database-product claims are out of scope.

Existence flag per left row: left tableemp_idnamedept_id1Ada102Ben203Cy204Dee305EliNULL Existence flag per left row: right tabledept_iddept_name10ops20eng20platformNULLunknown candidate pairsleftSourcerightSourceleftKeyrightKeymatched00[10][10]yes01[10][20]no02[10][20]no03[10][NULL]no10[20][10]no11[20][20]yes12[20][20]yes13[20][NULL]no20[20][10]no21[20][20]yes22[20][20]yes23[20][NULL]no30[30][10]no31[30][20]no32[30][20]no33[30][NULL]no40[NULL][10]no41[NULL][20]no42[NULL][20]no43[NULL][NULL]no existence per left rowleftSourceleftKeymatchingRightSourcesexistskept0[10][0]yesyes1[20][1, 2]yesyes2[20][1, 2]yesyes3[30][]nono4[NULL][]nono semi join kept-left rowsemp_idnamedept_id1Ada102Ben203Cy20 semi join factsfactvalueleftRowCount5rightRowCount4candidatePairCount20matchingPairCount5leftRowsWithMatch3keptLeftRows3droppedLeftRows2duplicateRightMatches2nullKeyCandidatePairs8modesemirowOrderleft_source_order_once

One flag per left row

The existence table has one row per left source row.

one flag per left row\text{one flag per left row}

Summary

Semi join keeps rows by this flag, not by pair count.

flag controls keep\text{flag controls keep}