pub struct AgmBound;the min*max shortcut was unsound for 3+ relations and now simply returns ProductBound; use samkhya_core::degree::JoinGraph for a bound that is both provable and tighter
Expand description
Cartesian-product bound retained under its historical name.
ยงSoundness note (changed in 1.2.0)
Through v1.1 this returned min(product, |R_min| ยท |R_max|). That
shortcut is not an AGM bound and is unsound for three or more relations:
three 3-row relations chained on one shared key value join to 27 rows,
while the shortcut returned 9. Given only row counts and which pairs are
joined, the Cartesian product is the only sound ceiling โ every row of
every relation may share a single key value. This type therefore now
returns exactly ProductBound.
To do better, supply degree statistics via crate::degree::JoinGraph,
which bounds the same foreign-key join at 100 rows instead of 1000.
ยงExamples
use samkhya_core::lpbound::{AgmBound, ProductBound, UpperBound};
let r = [1_000u64, 1_000_000];
assert_eq!(
AgmBound.ceiling(&r, &[(0, 1)]),
ProductBound.ceiling(&r, &[])
);