Relational Rewrite Laws and Filter Placement
Push a predicate across a join only when the referenced fields and row-preservation rules justify it.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Independent inner-join inputs can be filtered before pairing
For an inner join, a deterministic predicate mentioning only the left relation can usually be applied to that relation before joining. Each pair survives exactly when its left member passes. This reduces work without changing multiplicity under usual bag filtering. Additional observable effects or error behavior can restrict transformations outside pure relational semantics.
An outer join deliberately creates unmatched rows
If a left outer join produces an unmatched row, right-side attributes are missing. Filtering on right-side equality after the join removes that row because the predicate is unknown. Applying that filter only inside the right input leaves the left row eligible to appear as unmatched. Those plans therefore differ. Three-valued logic supplies the evaluation, and query plan analysis helps locate the filter that was actually executed.[1][2]