Skip to main content

AgmBound

Struct AgmBound 

Source
pub struct AgmBound;
๐Ÿ‘ŽDeprecated since 1.2.0:

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, &[])
);

Trait Implementationsยง

Sourceยง

impl UpperBound for AgmBound

Sourceยง

fn ceiling( &self, relations: &[u64], _equality_predicates: &[(usize, usize)], ) -> u64

Compute the inclusive ceiling for a join. Read more

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V