pub struct Observed {
pub rows: u64,
pub nulls: u64,
pub distinct: bool,
pub sorted: bool,
pub min: Option<i128>,
pub max: Option<i128>,
}Expand description
What the build saw while it read the parent key column.
This is the cardinality verification of section 2.3, and it is written into the header rather
than recomputed because the build already had every value in front of it. Recording what was
observed rather than what was declared is what keeps a wrong FOREIGN KEY from producing a
wrong answer: a declaration that fails verification is reported, and no link is built.
Fields§
§rows: u64Non-null values seen.
nulls: u64Nulls seen, which are not keys and match no child row.
distinct: boolWhether every non-null value was distinct. False means no link may be built at all.
sorted: boolWhether the values arrived in non-decreasing order.
min: Option<i128>The smallest non-null value, or None when there were none.
max: Option<i128>The largest non-null value, or None when there were none.
Implementations§
Source§impl Observed
impl Observed
Sourcepub fn usable_as_parent(&self) -> bool
pub fn usable_as_parent(&self) -> bool
Whether this column can be the parent side of a link.
Distinctness is the whole requirement. A parent side that is not unique is not an error and is not a link: section 2.3 says it is a relationship that has to be executed as an ordinary join, and the planner is told so rather than left to find out.