Skip to main content

Module result

Module result 

Source
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 outside upper are guaranteed not in the answer.

The three pre-existing “shapes” map onto degenerate intervals:

Old variantInterval 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§

IndexExprResult
Result of an index search after NULL rows have been dropped. This is what the read planner consumes.
NullableIndexExprResult
Result of an index search before NULL rows are dropped. Each endpoint is a NullableRowAddrMask carrying SQL three-valued logic info.

Enums§

IndexExprResultWireFormat