Expand description
Interval-shaped wrappers around a row-address mask returned by a scalar-index expression evaluation.
Each result describes a closed interval [lower, upper] in the
lattice of subsets:
lower— rows the index guarantees are in the answer.upper— rows that might be in the answer; rows outsideupperare guaranteed not in the answer.
The three pre-existing “shapes” map onto degenerate intervals:
| Old variant | Interval form |
|---|---|
Exact(m) | {lower: m, upper: m} |
AtMost(m) | {lower: allow_nothing(), upper: m} |
AtLeast(m) | {lower: m, upper: all_rows()} |
Use IndexExprResult::exact / IndexExprResult::at_most /
IndexExprResult::at_least to construct those shapes, and the
matching IndexExprResult::is_exact etc. predicates to inspect
them. Intervals that are neither (the “Refined” case — a non-empty
lower strictly inside a non-universe upper) arise from indices
that can distinguish guaranteed-match from candidate-match rows
within a single search (e.g. a zone map answering IS NOT NULL).
The boolean algebra (Not / BitAnd / BitOr) is elementwise on
the endpoints:
!{l, u} = {!u, !l}
{l1, u1} & {l2, u2} = {l1 & l2, u1 & u2}
{l1, u1} | {l2, u2} = {l1 | l2, u1 | u2}This works for both the post-drop_nulls form (IndexExprResult,
backed by RowAddrMask) and the during-evaluation form
(NullableIndexExprResult, backed by NullableRowAddrMask) —
the per-endpoint algebra already implements two-valued and SQL
three-valued logic correctly inside each mask type.
Structs§
- Index
Expr Result - Result of an index search after NULL rows have been dropped. This is what the read planner consumes.
- Nullable
Index Expr Result - Result of an index search before NULL rows are dropped. Each endpoint
is a
NullableRowAddrMaskcarrying SQL three-valued logic info.